Example #1
0
 public bool Ready(Team team)
 {
     if ((TeamHandler.GetCamps(team).Count == _maxCamps) && (TeamHandler.GetUnits(team).Count == _maxUnits))
     {
         team.Ready = true;
         return(true);
     }
     return(false);
 }
Example #2
0
        public bool PlaceUnit(string teamName, IUnit unit, int row, int col)
        {
            var team = _boardHandler.GetTeamByName(teamName);

            if (team != null)
            {
                var availBlocks = _boardHandler.GetInitArea(team);
                if (availBlocks.Exists(b => b.Column == col && b.Row == row))
                {
                    if (((unit is Camp) && TeamHandler.GetCamps(team).Count < _maxCamps) ||
                        (!(unit is Camp) && TeamHandler.GetUnits(team).Count < _maxUnits))
                    {
                        unit.Row    = row;
                        unit.Column = col;
                        unit.Team   = team;
                        team.Units.Add(unit);
                        return(true);
                    }
                }
            }

            return(false);
        }