Class Thing
Class that represents all things in the game.
Inherited Members
Namespace: Fibula.Common
Assembly: Fibula.Common.dll
Syntax
public abstract class Thing : IThing, ILocatable, IContainedThing, IEquatable<IThing>
Constructors
| Improve this Doc View SourceThing()
Initializes a new instance of the Thing class.
Declaration
public Thing()
Properties
| Improve this Doc View SourceCanBeMoved
Gets a value indicating whether this thing can be moved.
Declaration
public abstract bool CanBeMoved { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
CarryLocation
Gets the location where this thing is being carried at, if any.
Declaration
public abstract Location? CarryLocation { get; }
Property Value
Type | Description |
---|---|
System.Nullable<Location> |
Conditions
Gets the current condition information for the thing.
Declaration
public IDictionary<ConditionType, ICondition> Conditions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<ConditionType, ICondition> |
Remarks
The key is a ConditionType, and the value is the ICondition.
Location
Gets this thing's location.
Declaration
public virtual Location Location { get; }
Property Value
Type | Description |
---|---|
Location |
ParentContainer
Gets or sets the parent container of this thing.
Declaration
public IThingContainer ParentContainer { get; set; }
Property Value
Type | Description |
---|---|
IThingContainer |
TrackedEvents
Gets the tracked events for this thing.
Declaration
public IDictionary<string, IEvent> TrackedEvents { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, IEvent> |
TypeId
Gets the type id of this thing.
Declaration
public abstract ushort TypeId { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
UniqueId
Gets the unique id of this item.
Declaration
public Guid UniqueId { get; }
Property Value
Type | Description |
---|---|
System.Guid |
Methods
| Improve this Doc View SourceDescribeForLogger()
Provides a string describing the current thing for logging purposes.
Declaration
public abstract string DescribeForLogger()
Returns
Type | Description |
---|---|
System.String | The string to log. |
Equals(IThing)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(IThing other)
Parameters
Type | Name | Description |
---|---|---|
IThing | other | The other object to compare against. |
Returns
Type | Description |
---|---|
System.Boolean | True if the current object is equal to the other parameter, false otherwise. |
RaiseLocationChanged(Location)
Invokes the LocationChanged event on this thing.
Declaration
public void RaiseLocationChanged(Location fromLocation)
Parameters
Type | Name | Description |
---|---|---|
Location | fromLocation | The location from which the change happened. |
StartTrackingEvent(IEvent, String)
Makes the thing start tracking an event.
Declaration
public void StartTrackingEvent(IEvent evt, string identifier = "")
Parameters
Type | Name | Description |
---|---|---|
IEvent | evt | The event to stop tracking. |
System.String | identifier | Optional. The identifier under which to start tracking the event. If no identifier is provided, the event's type name is used. |
StopTrackingEvent(IEvent, String)
Makes the thing stop tracking an event.
Declaration
public void StopTrackingEvent(IEvent evt, string identifier = "")
Parameters
Type | Name | Description |
---|---|---|
IEvent | evt | The event to stop tracking. |
System.String | identifier | Optional. The identifier under which to look for and stop tracking the event. If no identifier is provided, the event's type name is used. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
Events
| Improve this Doc View SourceLocationChanged
Event to invoke when the thing's location has changed.
Declaration
public event OnLocationChanged LocationChanged
Event Type
Type | Description |
---|---|
OnLocationChanged |