File size: 3,233 Bytes
24b81cb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
//Generic entities from GameLib (script side of c++ classes)
#ifdef COMPONENT_SYSTEM
class GenericEntity extends IEntity
{
//native method implemented on c++ side
proto native void Show(bool show);
/*!
Finds first occurance of the coresponding component.
\param typeName type of the component
*/
proto native GenericComponent FindComponent(typename typeName);
/*!
inserts instance of the script component to the entity.
Calls OnComponentInsert on all entity's components to inform that this new component was inserted. The new instance have to FindScriptComponents in order to work with them.
Calls EOnInit on the component if component sets EV_INIT mask.
Calls EOnActivate on the component if the component is active (default)
\param component instance
*/
proto native void InsertComponent(GenericComponent component);
/*!
Removes component from entity. Doesn't delete the entity.
Calls EOnDeactivate on the component.
Calls OnComponentRemove on all entity's components to inform that this new component was removed.
\param component instance
*/
proto native void RemoveComponent(GenericComponent component);
/*!
Removes and deletes component from entity.
Calls EOnDeactivate on the component.
Calls OnComponentRemove on all entity's components to inform that this new component was removed.
Calls OnDelete on the component.
\param component instance
*/
proto native void DeleteComponent(GenericComponent component);
#ifdef WORKBENCH
/*!
Called after updating world in Workbench. The entity must be selected.
*/
void _WB_AfterWorldUpdate(float timeSlice) {};
#endif
}
class GenericWorldEntity extends GenericEntity
{
}
class GenericTerrainEntity extends GenericEntity
{
}
class LightEntity extends GenericEntity
{
/*!
Sets diffuse part of light.
\param color Color of light
*/
proto native external void SetDiffuseColor(int color);
proto native external int GetDiffuseColor();
proto native external void SetRadius(float radius);
proto native external float GetRadius();
/*!
Sets cone of light. It's meaningful for LT_SPOT only!
\param angle
*/
proto native external void SetConeAngle(float angle);
/*!
Gets cone of light. It's meaningful for LT_SPOT only!
\return Cone of light
*/
proto native external float GetConeAngle();
proto native external void SetCastShadow(bool enable);
proto native external bool IsCastShadow(bool enable);
}
class GenericWorldLightEntity extends GenericEntity
{
}
class GenericWorldFogEntity extends GenericEntity
{
}
class BasicEntity extends GenericEntity
{
}
class WorldEntityClass
{
}
class WorldEntity extends GenericWorldEntity
{
}
class ModelEntity extends BasicEntity
{
}
enum CharacterMovement
{
MOVEMENTTYPE_IDLE,
MOVEMENTTYPE_WALK,
MOVEMENTTYPE_RUN,
MOVEMENTTYPE_SPRINT
};
enum CharacterStance
{
STANCE_ERECT,
STANCE_CROUCH,
STANCE_PRONE,
STANCE_ERECT_RAISED,
STANCE_CROUCH_RAISED,
STANCE_PRONE_RAISED
};
class CharacterEntity extends BasicEntity
{
proto native void Teleport(vector transform[4]);
proto native CharacterMovement GetCurrentMovement();
proto native CharacterStance GetCurrentStance();
}
class BasicCamera extends BasicEntity
{
}
class VRHandEntity extends GenericEntity
{
}
#endif |