Пример #1
0
        public void AddUnit(int Col, int Row, int unitType, NATIONALITY nationality)
        {
            _units.Add(Col, Row, unitType, nationality);

            if (nationality == NATIONALITY.USA)
            {
                var newUnit = _units.FindUnit(Col, Row);
                _terrainMap.UnmaskBoard(Col, Row, newUnit.ViewRange);
                _terrainMap.SetView(Col, Row, newUnit.ViewRange);
            }
        }
Пример #2
0
        public void PlayerMoveUnit(Unit unit, int col, int row)
        {
            if (unit.Nationality == NATIONALITY.USA)
            {
                // make sure this doesn't go off the map
                if (_terrainMap[col, row] != null)
                {
                    unit.Col = col;
                    unit.Row = row;

                    _terrainMap.UnmaskBoard(unit.Col, unit.Row, unit.ViewRange);
                    RecomputeView();

                    if (unit.Movement < 0.1)
                    {
                        _units.PlayerCheckForPossibleAttack(unit, _alliedEnemyMatrix);
                    }
                }
            }
        }