Class CharacterLinks
Making and reaching characters' Core entities. Feature state lives as components on the entity; the archetype (player, NPC) gives each new entity what the installed modules add to it.
public static class CharacterLinks
- Inheritance
-
CharacterLinks
- Inherited Members
Methods
Component<T>(ICharacter)
character's T, by reference, given it when it has none (the
module that owns T normally adds it through the archetype). Throws when the
character has no entity: it is not spawned and was not loaded, or no Core world runs on its side.
public static ref T Component<T>(this ICharacter character) where T : struct
Parameters
characterICharacter
Returns
- T
Type Parameters
T
CoreLink(ICharacter)
character's entity, or FishMMO.Core.EntityLink.None.
public static EntityLink CoreLink(this ICharacter character)
Parameters
characterICharacter
Returns
- EntityLink
Destroy(EntityLink)
Ends link's entity: at once, or at the end of the phase while its world ticks.
public static void Destroy(EntityLink link)
Parameters
linkEntityLink
HasCoreEntity(ICharacter)
Whether character has an entity, so Component<T>(ICharacter) can be asked.
public static bool HasCoreEntity(this ICharacter character)
Parameters
characterICharacter
Returns
TryCreate(NetworkManager, SimulationSide, string, ICharacter, out EntityLink)
A new entity of archetype in networkManager's
side world, standing for character. False when that side runs no
world (it is not started).
public static bool TryCreate(NetworkManager networkManager, SimulationSide side, string archetype, ICharacter character, out EntityLink link)
Parameters
networkManagerNetworkManagersideSimulationSidearchetypestringcharacterICharacterlinkEntityLink