Class ObjectType<TEntry, TObject>
Represents objects that consists of entries that represent a certain Object type.
Inherited Members
Namespace: InsaneScatterbrain.MapGraph
Syntax
[Serializable]
public abstract class ObjectType<TEntry, TObject> : DataSetItem, IObjectType<TEntry, TObject>, IDataSetItem where TEntry : IObjectTypeEntry<TObject> where TObject : Object
Type Parameters
Name | Description |
---|---|
TEntry | The entry type. |
TObject | The object type. |
Constructors
ObjectType(string)
Declaration
protected ObjectType(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name |
Properties
Entries
Gets entries of this type.
Declaration
public ReadOnlyCollection<TEntry> Entries { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<TEntry> |
IsWeightEnabled
Whether or not weighting is enabled. If disabled, the weights shouldn't be taken into consideration and be treated as if they're all equal.
Declaration
public bool IsWeightEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
OpenEntries
A less restricted collection of the entries for protected use.
Declaration
protected abstract List<TEntry> OpenEntries { get; }
Property Value
Type | Description |
---|---|
List<TEntry> |
TotalWeight
The combined weight of all the entries.
Declaration
public float TotalWeight { get; }
Property Value
Type | Description |
---|---|
float |
Methods
AddNewEntry()
Creates and adds a new entry this object type.
Declaration
public void AddNewEntry()
CalculateTotalWeight()
Calculates the total weight.
Declaration
public void CalculateTotalWeight()
Clean()
Remove any empty entries.
Declaration
public void Clean()
MoveEntry(int, int)
Moves the entry's position within the list.
Declaration
public void MoveEntry(int oldIndex, int newIndex)
Parameters
Type | Name | Description |
---|---|---|
int | oldIndex | The old index. |
int | newIndex | The new index. |
NewEntry()
Creates and returns an entry for this object type.
Declaration
protected abstract TEntry NewEntry()
Returns
Type | Description |
---|---|
TEntry | The new entry. |
RemoveEntry(int)
Removes an entry from the object type.
Declaration
public void RemoveEntry(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of entry. |