Example #1
0
        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());
        }
Example #2
0
 public void AddEntity(GameEntityState entity)
 {
     this.AddEntity(entity.id, entity);
 }