public void AddEntity(string id, GameEntityState entity) { if (this.entitiesMap.ContainsKey(id)) { throw new Exception($"Game State already contains entity with ID = {id}"); } this.entitiesMap[id] = entity; this.jsonEntities.Add(entity.ToJson()); }
public void AddEntity(GameEntityState entity) { this.AddEntity(entity.id, entity); }