public static Entity ToEntity(this SpawnMsg msg) { var entity = EntityManager.Instance.CreateEntity(msg.Id); Assign(entity, msg); return(entity); }
public static void Assign(this SpawnMsg msg, Entity entity) { msg.Id = entity.Id; msg.Name = entity.Get <Nameplate>().Name; Assign(msg.CharacterResource, entity); Assign(msg.UpdatePosition, entity); }
public static SpawnMsg ToSpawnMsg(this Entity entity) { var msg = new SpawnMsg(); Assign(msg, entity); return(msg); }
public static void Assign(this Entity entity, SpawnMsg msg) { EntityHelper.SetEntityId(entity, msg.Id); entity.Get <Nameplate>().Name = msg.Name; Assign(entity, msg.CharacterResource); Assign(entity, msg.UpdatePosition); }
public void Spawn(int tilex, int tiley) { using (var ms = new MemoryStream()) { var msg = new SpawnMsg() { PlayerIndex = (byte)Index, TileX = tilex, TileY = tiley }; msg.PackFull(ms); SendRawData(ms.ToArray()); } }