Class Positionable<TCoordinates>
- Namespace
- AlphaFramework.World.Positionables
- Assembly
- AlphaFramework.World.dll
An object that can be positioned in the game world.
public abstract class Positionable<TCoordinates> : ICloneable, IChangeNotify<Positionable<TCoordinates>> where TCoordinates : struct
Type Parameters
TCoordinates
Data type for storing position coordinates of objects in the game world.
- Inheritance
-
Positionable<TCoordinates>
- Implements
-
IChangeNotify<Positionable<TCoordinates>>
- Derived
- Inherited Members
- Extension Methods
Properties
Name
Used for identification in scripts, debugging, etc.
public string? Name { get; set; }
Property Value
Position
The Positionable<TCoordinates>'s position.
public TCoordinates Position { get; set; }
Property Value
- TCoordinates
Methods
Clone()
Creates a deep copy of this Positionable<TCoordinates>.
public virtual Positionable<TCoordinates> Clone()
Returns
- Positionable<TCoordinates>
The cloned Positionable<TCoordinates>.
OnChanged()
To be called when a property relevant for rendering has changed.
protected virtual void OnChanged()
OnChangedRebuild()
To be called when a property has changed, that requires visual representations to be rebuilt from scratch (usually a template).
protected void OnChangedRebuild()
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Events
Changed
Occurs when a property relevant for rendering has changed.
public event Action<Positionable<TCoordinates>>? Changed
Event Type
- Action<Positionable<TCoordinates>>
ChangedRebuild
Occurs when a property has changed that requires visual representations to rebuilt from scratch (usually a template).
public event Action<Positionable<TCoordinates>>? ChangedRebuild
Event Type
- Action<Positionable<TCoordinates>>