Table of Contents

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

Guid

Methods

Equals(Component)

Whether other has the same Id as this component.

protected bool Equals(Component other)

Parameters

other Component

Returns

bool

Equals(IUpdateable)

Whether other has the same Id as this component. False when other is null.

public bool Equals(IUpdateable other)

Parameters

other IUpdateable

Returns

bool

Equals(object)

Whether obj is a component of the same type with the same Id.

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

Returns a hash code based on Id, consistent with Equals(object).

public override int GetHashCode()

Returns

int

Update(IGameTime)

Advances the component's state by one frame.

public abstract void Update(IGameTime gameTime)

Parameters

gameTime IGameTime

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

left Component
right Component

Returns

bool

operator ==(Component, IUpdateable)

Whether left and right have the same Id. Two nulls are equal.

public static bool operator ==(Component left, IUpdateable right)

Parameters

left Component
right IUpdateable

Returns

bool

operator !=(Component, Component)

Whether left and right have different Id values.

public static bool operator !=(Component left, Component right)

Parameters

left Component
right Component

Returns

bool

operator !=(Component, IUpdateable)

Whether left and right have different Id values.

public static bool operator !=(Component left, IUpdateable right)

Parameters

left Component
right IUpdateable

Returns

bool