Example #1
0
 public AIObject(AIRoleType r, Vector3 p, bool isBot)
     : base()
 {
     _team = null;
     _isBot = isBot;
     if (r == AIRoleType.TeamLeader)
     {
         //r = AIRoleType.Infantry;
         _isLeader = true;
     }
     _role = r;
     Status = AIMovementStatus.Walk;
     Position = p;
 }
Example #2
0
        public void SelectTeam(AITeamType team)
        {
            ClearSelect();
            foreach (AITeam t in _teams)
            {
                if(t.TeamType == team)
                    _selectedTeam = t;
            }
            foreach (AIObject aiobj in _aiobjects)
            {
                if (aiobj.Team == _selectedTeam)
                {
                    aiobj.Selected = true;

                    if (aiobj.IsLeader)
                    {
                        _selectedObject = aiobj;
                        aiobj.Selected = true;
                    }
                }
            }
        }
Example #3
0
 public void Select(AIObject item)
 {
     ClearSelect();
     _selectedObject = item;
     _selectedTeam = item.Team;
     item.Selected = true;
 }
Example #4
0
 public void CreateTeam(AITeamType type, Color color, int numInfantry, int numSniper, int numSupport, Vector3 position, bool areBots)
 {
     AITeam team = new AITeam(type, color);
     team.Add(new AIObject(AIRoleType.TeamLeader, position, areBots));
     for (int i = 0; i < numInfantry; i++)
         team.Add(new AIObject(AIRoleType.Infantry, position, areBots));
     for (int i = 0; i < numSniper; i++)
         team.Add(new AIObject(AIRoleType.Sniper, position, areBots));
     for (int i = 0; i < numSupport; i++)
         team.Add(new AIObject(AIRoleType.Support, position, areBots));
     _teams.Add(team);
 }
Example #5
0
 public void ClearSelect()
 {
     foreach (AIObject aiobj in _aiobjects)
         aiobj.Selected = false;
     _selectedObject = null;
     _selectedTeam = null;
 }