Beispiel #1
0
        public void RemoveUnit(SPoint position)
        {
            ICell unitCell = GetCell(position);

            unitCell.Unit = null;
            MapUpdated?.Invoke(this, EventArgs.Empty);
        }
Beispiel #2
0
        public Boolean SetUnit(IPositionable unit, SPoint point)
        {
            //TODO: Check cell on free space
            ICell cell = GetCell(point);

            cell.Unit = unit;
            MapUpdated?.Invoke(this, EventArgs.Empty);
            return(true);
        }
Beispiel #3
0
        public void ChangeMap(IAreaMap newMap, Point playerPosition)
        {
            log.Debug("Changing map");
            Map = newMap;
            Map.AddObject(playerPosition, Player);
            PlayerPosition = playerPosition;

            MapUpdated?.Invoke(this, EventArgs.Empty);
        }
Beispiel #4
0
        public void Move(IMovable unit, SPoint oldPosition, SPoint newPosition)
        {
            ICell oldCell        = GetCell(oldPosition);
            ICell newCell        = GetCell(newPosition);
            Int32 transferEnergy = GetPenalty(oldPosition);

            oldCell.Unit       = null;
            newCell.Unit       = unit;
            unit.MovingEnergy -= transferEnergy;
            unit.SetPosition(newPosition);
            MapUpdated?.Invoke(this, EventArgs.Empty);
        }
Beispiel #5
0
 private void ProcessSystemTurn()
 {
     CurrentTurn++;
     Map.Update(this);
     MapUpdated?.Invoke(this, EventArgs.Empty);
 }