Arcade
|
Base class for game objects that may have attached Sprite graphics and update logic. More...
Public Member Functions | |
Entity () | |
Constructs a new Entity. More... | |
T | Add< T > (T sprite, int layer=0) |
Adds a Sprite to the given layer of this entity. More... | |
void | Remove (Sprite sprite) |
Removes the given Sprite if it exists. More... | |
void | SetSpriteLayer (Sprite sprite, int layer) |
Removes the given Sprite if it exists. More... | |
int | GetSpriteLayer (Sprite sprite) |
Gets the rendering layer of the given Sprite. More... | |
void | CalculateBounds () |
Calculates the smallest bounds that contains every Sprite on this entity. More... | |
void | SetFlags (params Enum[] flags) |
Sets flags to identify this entity with. More... | |
void | ClearFlags (params Enum[] flags) |
Removes any flags set for this entity. More... | |
bool | HasAllFlags (params Enum[] flags) |
Does this entity have all the given flags? More... | |
bool | HasAnyFlags (params Enum[] flags) |
Does this entity have any of the given flags? More... | |
TEnum | GetFlags< TEnum > () |
Gets the combined value of all set flags of the given enumeration type associated with this Entity. More... | |
void | LoadGraphics (Graphics graphics) |
Called automatically for entities added to a Stage as soon as it is appropriate for them to load graphical resources. More... | |
void | LoadAudio (Audio audio) |
Called automatically for entities added to a Stage as soon as it is appropriate for them to load audio resources. More... | |
void | Update (double dt) |
Updates this entity, this already gets called every tick but it can be called again if needed. More... | |
void | Render (Graphics graphics) |
Renders this entity, this already gets called every tick but it can be called again if needed. More... | |
IEnumerator< Sprite > | GetEnumerator () |
Protected Member Functions | |
virtual void | OnEnterStage (Stage stage) |
Called when this entity enters a Stage. More... | |
virtual void | OnLeaveStage (Stage stage) |
Called when this entity leaves a Stage. More... | |
override Stage | GetStage () |
Should return the Stage containing this instance, used to find things like the time step to use for Delay awaitables. More... | |
virtual void | OnLoadGraphics (Graphics graphics) |
Called when this entity should load any required graphics resources. More... | |
virtual void | OnLoadAudio (Audio audio) |
Called when this entity should load any required audio resources. More... | |
virtual void | OnReady () |
Called when both graphics and audio have finished loading. More... | |
virtual void | OnUpdate (double dt) |
Called every tick to update this entity. More... | |
virtual void | OnRender (Graphics graphics) |
Called every tick to draw a frame of this entity. More... | |
Protected Member Functions inherited from GameAPI.BudgetBoy.CoroutineContainer | |
CoroutineContainer () | |
Base constructor for a CoroutineContainer with an empty CoroutineCollection. More... | |
Awaitable | Delay (double seconds) |
Creates a Delay Awaitable representing a pause of execution for the given duration. More... | |
Awaitable | While (Func< bool > predicate) |
Creates a While Awaitable representing a pause of execution while the given predicate evaluates as true, where evaluation occurs each update. More... | |
Awaitable | Until (Func< bool > predicate) |
Creates an Until Awaitable representing a pause of execution until the given predicate evaluates as true, where evaluation occurs each update. More... | |
Awaitable | Sequential (params Awaitable[] inner) |
Creates a Sequential Awaitable representing a pause of execution until all elements of the given array of Awaitables have been executed in sequence. More... | |
Awaitable | Parallel (params Awaitable[] inner) |
Creates a Parallel Awaitable representing a pause of execution until all elements of the given array of Awaitables have been executed concurrently. More... | |
Awaitable | PlayAnimation (Animation anim) |
Creates a PlayAnimation Awaitable representing a pause of execution until the given Animation has completed. The animation will be advanced automatically. More... | |
Awaitable | PlayAnimation (Animation anim, Awaitable @while) |
Creates a PlayAnimation Awaitable representing a pause of execution until either the given Animation or Awaitable has completed. The animation will be advanced automatically. Used for looping animations that would otherwise never terminate. More... | |
Awaitable | WaitForAnimation (Animation anim) |
Creates a PlayAnimation Awaitable representing a pause of execution until the given Animation has completed. The animation will not be advanced automatically. More... | |
Awaitable | WaitForAnimation (Animation anim, Awaitable @while) |
Creates a PlayAnimation Awaitable representing a pause of execution until either the given Animation or Awaitable has completed. The animation will not be advanced automatically. Used for looping animations that would otherwise never terminate. More... | |
Coroutine | StartCoroutine (params Object[] awaitables) |
Starts a coroutine from a sequence of objects that can be converted to Awaitable instances. More... | |
Coroutine | StartCoroutine (IEnumerator routine) |
Starts a coroutine from an IEnumerator that is expected to yeild Awaitable instances, null references (to delay until next the update), or other IEnumerator coroutines. When another IEnumerator is yielded the parent IEnumerator will pause execution until the child IEnumerator has finished. More... | |
Coroutine | StartCoroutine (Func< IEnumerator > routine) |
Starts a coroutine from a function returning IEnumerator that is expected to yeild Awaitable instances, null references (to delay until next the update), or other IEnumerator coroutines. When another IEnumerator is yielded the parent IEnumerator will pause execution until the child IEnumerator has finished. More... | |
void | UpdateCoroutines () |
Causes all active Coroutine instances attached to this CoroutineContainer to execute one step. More... | |
Properties | |
bool | HasLoadedGraphics [get] |
Has the graphics for this entity loaded yet? More... | |
bool | HasLoadedAudio [get] |
Has the audio for this entity loaded yet? More... | |
Vector2F | Position [get, set] |
Local position. More... | |
float | X [get, set] |
Local x-position. More... | |
float | Y [get, set] |
Local y-position. More... | |
float | PanValue [get] |
Pan value that can be used to set the panning for audio sources emitted from this entity. More... | |
bool | IsVisible [get, set] |
Does this entity get rendered? More... | |
bool | IsActive [get, set] |
Does this entity get updated? More... | |
bool | AutoCalculateBounds [get] |
Does this entity automatically calculate its bounds from those of attached sprites? More... | |
RectF | LocalBounds [get, set] |
Local rectangle bounds. Setting this will disable auto bounds calculation. More... | |
RectF | Bounds [get] |
Local rectangle bounds. More... | |
Stage | Stage [get, set] |
The Stage this entity is currently added to. More... | |
Game | Game [get] |
The Game this entity's Stage is a part of. More... | |
Base class for game objects that may have attached Sprite graphics and update logic.
|
inline |
Constructs a new Entity.
|
inline |
|
inline |
Calculates the smallest bounds that contains every Sprite on this entity.
|
inline |
Removes any flags set for this entity.
|
inline |
|
inline |
Gets the combined value of all set flags of the given enumeration type associated with this Entity.
TEnum | Enumeration type to retrieve the value of. |
TEnum | : | struct | |
TEnum | : | IComparable | |
TEnum | : | IConvertible | |
TEnum | : | IFormattable |
|
inline |
|
inlineprotectedvirtual |
Should return the Stage containing this instance, used to find things like the time step to use for Delay awaitables.
Implements GameAPI.BudgetBoy.CoroutineContainer.
|
inline |
Does this entity have all the given flags?
flags | One or more enum flags. |
|
inline |
Does this entity have any of the given flags?
flags | One or more enum flags. |
|
inline |
|
inline |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Called when both graphics and audio have finished loading.
|
inlineprotectedvirtual |
Called every tick to draw a frame of this entity.
graphics | The Graphics context that will render this entity. |
|
inlineprotectedvirtual |
Called every tick to update this entity.
dt | The time since last update. |
|
inline |
|
inline |
Renders this entity, this already gets called every tick but it can be called again if needed.
Implements GameAPI.BudgetBoy.IRenderable.
|
inline |
Sets flags to identify this entity with.
flags | One or more enum flags to set. |
|
inline |
|
inline |
Updates this entity, this already gets called every tick but it can be called again if needed.
Implements GameAPI.BudgetBoy.IUpdatable.
|
get |
Does this entity automatically calculate its bounds from those of attached sprites?
|
get |
Local rectangle bounds.
|
get |
Has the audio for this entity loaded yet?
|
get |
Has the graphics for this entity loaded yet?
|
getset |
Does this entity get updated?
|
getset |
Does this entity get rendered?
|
getset |
Local rectangle bounds. Setting this will disable auto bounds calculation.
|
get |
Pan value that can be used to set the panning for audio sources emitted from this entity.
|
getset |
Local position.
|
getset |
Local x-position.
|
getset |
Local y-position.