WorldAsset

Namespace: Murder.Assets
Assembly: Murder.dll

public class WorldAsset : GameAsset, IWorldAsset

Implements: GameAsset, IWorldAsset

⭐ Constructors

public WorldAsset()

⭐ Properties

CanBeCreated

public virtual bool CanBeCreated { get; }

Returns
bool

CanBeDeleted

public virtual bool CanBeDeleted { get; }

Returns
bool

CanBeRenamed

public virtual bool CanBeRenamed { get; }

Returns
bool

CanBeSaved

public virtual bool CanBeSaved { get; }

Returns
bool

EditorColor

public virtual Vector4 EditorColor { get; }

Returns
Vector4

EditorFolder

public virtual string EditorFolder { get; }

Returns
string

Features

public ImmutableArray<T> Features { get; }

Returns
ImmutableArray<T>

FileChanged

public bool FileChanged { get; public set; }

Returns
bool

FilePath

public string FilePath { get; public set; }

Returns
string

Guid

public Guid Guid { get; protected set; }

Returns
Guid

HasSystems

public bool HasSystems { get; }

Returns
bool

Icon

public virtual char Icon { get; }

Returns
char

Instances

public virtual ImmutableArray<T> Instances { get; }

Returns
ImmutableArray<T>

IsStoredInSaveData

public virtual bool IsStoredInSaveData { get; }

Returns
bool

Name

public string Name { get; public set; }

Returns
string

Order

public readonly int Order;

This is the order in which this world will be displayed in game (when selecting a lvel, etc.)

Returns
int

Rename

public bool Rename { get; public set; }

Returns
bool

SaveLocation

public virtual string SaveLocation { get; }

Returns
string

StoreInDatabase

public virtual bool StoreInDatabase { get; }

Returns
bool

Systems

public ImmutableArray<T> Systems { get; }

Returns
ImmutableArray<T>

TaggedForDeletion

public bool TaggedForDeletion;

Returns
bool

WorldGuid

public virtual Guid WorldGuid { get; }

Returns
Guid

WorldName

public readonly string WorldName;

This is the world name used when fetching this world within the game.

Returns
string

⭐ Methods

OnModified()

protected virtual void OnModified()

PostProcessEntities(World, Dictionary<TKey, TValue>)

protected void PostProcessEntities(World world, Dictionary<TKey, TValue> instancesToEntities)

This makes any fancy post process once all entities were created in the world. This may trigger reactive components within the world.

Parameters
world World

instancesToEntities Dictionary<TKey, TValue>

AddFilter(string)

public bool AddFilter(string name)

Add a new filter to group entities.

Parameters
name string

Returns
bool

AddGroup(string)

public bool AddGroup(string name)

Add a new folder to group entities.

Parameters
name string

Returns
bool

BelongsToAnyGroup(Guid)

public bool BelongsToAnyGroup(Guid entity)

Checks whether an entity belongs to any group.

Parameters
entity Guid

Returns
bool

DeleteFilter(string)

public bool DeleteFilter(string name)

Delete a new filter to group entities.

Parameters
name string

Returns
bool

DeleteGroup(string)

public bool DeleteGroup(string name)

Delete a new folder to group entities.

Parameters
name string

Returns
bool

HasGroup(string)

public bool HasGroup(string name)

Parameters
name string

Returns
bool

IsOnFilter(Guid)

public bool IsOnFilter(Guid g)

Parameters
g Guid

Returns
bool

MoveToGroup(string, Guid, int)

public bool MoveToGroup(string targetGroup, Guid instance, int targetPosition)

Parameters
targetGroup string
instance Guid
targetPosition int

Returns
bool

Duplicate(string)

public GameAsset Duplicate(string name)

Parameters
name string

Returns
GameAsset

FetchFolderNames()

public IEnumerable<T> FetchFolderNames()

This is for editor purposes, return all the available folder names as anIEnumerable

Returns
IEnumerable<T>

FetchAllSystems()

public ImmutableArray<T> FetchAllSystems()

Returns
ImmutableArray<T>

FetchEntitiesGuidInFilter(string)

public ImmutableArray<T> FetchEntitiesGuidInFilter(string targetFilter)

Parameters
targetFilter string

Returns
ImmutableArray<T>

FetchEntitiesOfGroup(string)

public ImmutableArray<T> FetchEntitiesOfGroup(string name)

Parameters
name string

Returns
ImmutableArray<T>

FetchFilters()

public ImmutableDictionary<TKey, TValue> FetchFilters()

This is for editor purposes, we group all entities in "folders" when visualizing them. This has no effect in the actual game.

Returns
ImmutableDictionary<TKey, TValue>

FetchFolders()

public ImmutableDictionary<TKey, TValue> FetchFolders()

This is for editor purposes, we group all entities in "folders" when visualizing them. This has no effect in the actual game.

Returns
ImmutableDictionary<TKey, TValue>

GroupsCount()

public int GroupsCount()

Returns
int

AssetsToBeSaved()

public List<T> AssetsToBeSaved()

Returns
List<T>

FetchEntitiesInFilter(string)

public List<T> FetchEntitiesInFilter(string targetFilter)

Parameters
targetFilter string

Returns
List<T>

CreateInstance(Camera2D, ImmutableArray)

public MonoWorld CreateInstance(Camera2D camera, ImmutableArray<T> startingSystems)

Parameters
camera Camera2D
startingSystems ImmutableArray<T>

Returns
MonoWorld

CreateInstanceFromSave(SavedWorld, Camera2D, ImmutableArray)

public MonoWorld CreateInstanceFromSave(SavedWorld savedInstance, Camera2D camera, ImmutableArray<T> startingSystems)

Parameters
savedInstance SavedWorld
camera Camera2D
startingSystems ImmutableArray<T>

Returns
MonoWorld

GetGroupOf(Guid)

public string GetGroupOf(Guid entity)

Returns the group that an entity belongs.

Parameters
entity Guid

Returns
string

GetSimplifiedName()

public string GetSimplifiedName()

Returns
string

GetSplitNameWithEditorPath()

public String[] GetSplitNameWithEditorPath()

Returns
string[]

TryGetInstance(Guid)

public virtual EntityInstance TryGetInstance(Guid instanceGuid)

Parameters
instanceGuid Guid

Returns
EntityInstance

AfterDeserialized()

public virtual void AfterDeserialized()

AddInstance(EntityInstance)

public void AddInstance(EntityInstance e)

Parameters
e EntityInstance

MakeGuid()

public void MakeGuid()

MoveToFilter(string, Guid, int)

public void MoveToFilter(string targetFilter, Guid instance, int targetPosition)

Parameters
targetFilter string
instance Guid
targetPosition int

RemoveInstance(Guid)

public void RemoveInstance(Guid instanceGuid)

Parameters
instanceGuid Guid

TrackAssetOnSave(Guid)

public void TrackAssetOnSave(Guid g)

Parameters
g Guid

UpdateFeatures(ImmutableArray)

public void UpdateFeatures(ImmutableArray<T> features)

Parameters
features ImmutableArray<T>

UpdateSystems(ImmutableArray)

public void UpdateSystems(ImmutableArray<T> systems)

Parameters
systems ImmutableArray<T>

ValidateInstances()

public void ValidateInstances()

Validate instances are remove any entities that no longer exist in the asset.