Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

typescript class constructor default values

constructor(name: string, level: number, image: string, type: UnitTypes, scaleAttributes: Function, id?: number, side?: Side, position?: Position) {
        this._id = id || -1;
        this._side = side || Side.NEUTRAL;
        this._type = type;
        this._name = name;
        this._level = level;
        this._position = position || new Position(0, 0);
        this._health = scaleAttributes(level);
        this._image = image;
    }
 
PREVIOUS NEXT
Tagged: #typescript #class #constructor #default #values
ADD COMMENT
Topic
Name
6+3 =