예제 #1
0
파일: GridCell.cs 프로젝트: FeXyK/Authory
        public void Add(Entity mob)
        {
            mob.SetId(_next_id);

            if (MobEntities.TryAdd(mob.Id, mob))
            {
                _next_id++;

                mob.SetGridCell(this);
                EntityCount++;
                AllEntityCount++;
            }
        }
예제 #2
0
파일: GridCell.cs 프로젝트: FeXyK/Authory
        public void ReAdd(Entity mob)
        {
            if (MobEntities.TryAdd(mob.Id, mob))
            {
                GridCell cell = mob.GridCell;

                mob.SetGridCell(this);

                if (cell != null)
                {
                    cell.Remove(mob);
                }

                EntityCount++;
                AllEntityCount++;
            }
        }