Line data Source code
1 : /** 2 : * @file The Entity class stores the given template name, owner and location of an entity and assigns an entityID. 3 : * Instances of this class (with the position using the tile coordinate system) are 4 : * converted by ScriptConversions.cpp to the Entity struct defined in source/graphics/Entity.h and passed to MapReader.cpp. 5 : */ 6 : // TODO: support full position and rotation 7 : function Entity(entityID, templateName, playerID, position, orientation) 8 : { 9 0 : this.player = playerID; 10 0 : this.templateName = templateName; 11 0 : this.id = entityID; 12 0 : this.position = new Vector3D(position.x, 0, position.y); 13 0 : this.rotation = new Vector3D(0, orientation, 0); 14 : } 15 : 16 6 : Entity.prototype.GetPosition2D = function() 17 : { 18 0 : return Vector2D.from3D(this.position); 19 : };