
import {Game} from "@engine/core/game";
import {ResourceLink} from "@engine/resources/resourceLink";
import {ITexture} from "@engine/renderer/common/texture";
import {AbstractEntity} from "../../abstract/abstractEntity";
import {CollectableEntity} from "../abstract/collectableEntity";
import {ARCADE_RIGID_BODY_TYPE} from "@engine/physics/arcade/arcadeRigidBody";
import {Size} from "@engine/geometry/size";
import {IExtraProperties} from "../../actor/abstract/abstractCharacter";
import {Rect} from "@engine/geometry/rect";
import {Image, STRETCH_MODE} from "@engine/renderable/impl/general/image";
import {Optional} from "@engine/core/declarations";
import {RenderableModel} from "@engine/renderable/abstract/renderableModel";

export class Fan extends AbstractEntity {

    public static readonly groupName:string = 'fan';

    constructor(protected game:Game,resource:ResourceLink<ITexture>) {
        super(game, resource, {
            groupNames: [Fan.groupName],
            type:ARCADE_RIGID_BODY_TYPE.KINEMATIC,
        });
        const model = this.getRenderableModel();
        model.alpha = 0.5;
        model.setInterval(()=>{
            model.angle+=0.1;
            model.angle%=Math.PI*2;
        },100);
    }

}
