| Rev | Line | |
|---|
| [20337] | 1 | /**
|
|---|
| [20400] | 2 | * @file The Entity class stores the given template name, owner and location of an entity and assigns an entityID.
|
|---|
| [21069] | 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.
|
|---|
| [20337] | 5 | */
|
|---|
| [10326] | 6 | // TODO: support full position and rotation
|
|---|
| [21069] | 7 | function Entity(entityID, templateName, playerID, position, orientation)
|
|---|
| [9096] | 8 | {
|
|---|
| [21069] | 9 | this.player = playerID;
|
|---|
| [10326] | 10 | this.templateName = templateName;
|
|---|
| [21069] | 11 | this.id = entityID;
|
|---|
| 12 | this.position = new Vector3D(position.x, 0, position.y);
|
|---|
| 13 | this.rotation = new Vector3D(0, orientation, 0);
|
|---|
| 14 | }
|
|---|
| [18840] | 15 |
|
|---|
| [21069] | 16 | Entity.prototype.GetPosition2D = function()
|
|---|
| 17 | {
|
|---|
| 18 | return Vector2D.from3D(this.position);
|
|---|
| 19 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.