public override void OnStateEnter() { base.OnStateEnter(); _city.OnUnitSelected(); _cityCell = _city.Cell; _pathsInRange = _city.GetAvailableDestinations(_cellGrid.Cells); var cellsNotInRange = _cellGrid.Cells.Except(_pathsInRange); foreach (var cell in cellsNotInRange) { cell.UnMark(); } foreach (var cell in _pathsInRange) { cell.MarkAsReachable(); //able to create a unit } if (_city.ActionPoints <= 0) { return; } // foreach (var currentUnit in _cellGrid.Units) // { // if (currentUnit.PlayerNumber.Equals(_city.PlayerNumber)) // continue; // // if (_unit.IsUnitAttackable(currentUnit,_unit.Cell)) // { // currentUnit.SetState(new UnitStateMarkedAsReachableEnemy(currentUnit)); // _unitsInRange.Add(currentUnit); // } // } // if (_unitCell.GetNeighbours(_cellGrid.Cells).FindAll(c => c.MovementCost <= _unit.MovementPoints).Count == 0 // && _unitsInRange.Count == 0) // _unit.SetState(new UnitStateMarkedAsFinished(_unit)); }