Class Component
- Namespace
- BSGameLib.Game.Components
- Assembly
- BSGameLib.Game.dll
A game object with an Id, updated by the game each frame. Two components are equal when they have the same type and Id.
public abstract class Component : IUpdateable, IIdentifiable<Guid>, IEquatable<IUpdateable>
- Inheritance
-
Component
- Implements
- Derived
- Inherited Members
Properties
Id
Identifies the component. Set to a new GUID when the component is created; equality uses it.
public virtual Guid Id { get; set; }
Property Value
Methods
Equals(Component)
Whether other has the same Id as this component.
protected bool Equals(Component other)
Parameters
otherComponent
Returns
Equals(IUpdateable)
Whether other has the same Id as this component. False when other is null.
public bool Equals(IUpdateable other)
Parameters
otherIUpdateable
Returns
Equals(object)
Whether obj is a component of the same type with the same Id.
public override bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
Returns a hash code based on Id, consistent with Equals(object).
public override int GetHashCode()
Returns
Update(IGameTime)
Advances the component's state by one frame.
public abstract void Update(IGameTime gameTime)
Parameters
gameTimeIGameTime
Operators
operator ==(Component, Component)
Whether left and right have the same Id. Two nulls are equal.
public static bool operator ==(Component left, Component right)
Parameters
Returns
operator ==(Component, IUpdateable)
Whether left and right have the same Id. Two nulls are equal.
public static bool operator ==(Component left, IUpdateable right)
Parameters
leftComponentrightIUpdateable
Returns
operator !=(Component, Component)
Whether left and right have different Id values.
public static bool operator !=(Component left, Component right)
Parameters
Returns
operator !=(Component, IUpdateable)
Whether left and right have different Id values.
public static bool operator !=(Component left, IUpdateable right)
Parameters
leftComponentrightIUpdateable