Пример #1
0
        public void SetEnemyStrategy(STRATEGY strategy)
        {
            //_log.Debug("SetEnemyStrategy()" + strategy);
            _currentStrategy = strategy;

            if (_map.TotalCities == 0)
            {
                return;
            }

            if (strategy == STRATEGY.Defend)
            {
                foreach (var unit in _units)
                {
                    if (unit.Nationality == NATIONALITY.Germany)
                    {
                        unit.Command = UNITCOMMAND.Defend;
                        unit.DestCol = unit.Col;
                        unit.DestRow = unit.Row;
                    }
                }
                return;
            }

            if (strategy == STRATEGY.CaptureAllCities)
            {
                CaptureAllCitiesStrategy();
            }

            if (strategy == STRATEGY.AttackAllUnits)
            {
                AttackAllUnitsStrategy();
            }
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            var hIVTEST = obj as HIVTEST;

            return(hIVTEST != null &&
                   DATE.IsSameAs(hIVTEST.DATE) &&
                   RESULT.IsSameAs(hIVTEST.RESULT) &&
                   TYPE.IsSameAs(hIVTEST.TYPE) &&
                   FACILITY.IsSameAs(hIVTEST.FACILITY) &&
                   STRATEGY.IsSameAs(hIVTEST.STRATEGY));
        }
Пример #3
0
    // Start is called before the first frame update
    void Start()
    {
        view     = GetComponent <PhotonView>();
        collider = GetComponent <Collider>();
        object[] data = view.InstantiationData;
        faction = (FACTION)data[0];

        agent                = GetComponent <NavMeshAgent>();
        agent.speed          = movement / 100;
        agent.acceleration   = float.MaxValue;
        agent.updateRotation = false;
        strategy             = STRATEGY.ATTACK;
        transform.parent     = GameObject.Find("Environment").transform.Find("Enemies");
    }
    public void UpdateStrategy(STRATEGY strategy, RobotCarController nearestRobot)
    {
        Strategy = strategy;
        if (Strategy == STRATEGY.OFFENSE)
        {
            ArbiterController.ArbiterRobot = nearestRobot;
            switch (NoOfRobots)
            {
            case 3:
                if (nearestRobot != Defenders[0])
                {
                    Defenders[0].GetComponent <RobotCarController>().DestY = (Team == TEAM.BLUE) ? League.Small.Offense.OffensiveWait : League.Small.Offense.OffensiveWait * -1;
                    Defenders[0].GetComponent <RobotCarController>().DestX = 0;
                }
                else
                {
                    Forward[0].GetComponent <RobotCarController>().DestY = (Team == TEAM.BLUE) ? League.Small.Offense.OffensiveWait : League.Small.Offense.OffensiveWait * -1;
                    Forward[0].GetComponent <RobotCarController>().DestX = 0;
                }
                break;

            case 5:
                break;

            case 11:
                break;
            }
        }
        else
        {
            switch (NoOfRobots)
            {
            case 3:
                Defenders[0].GetComponent <RobotCarController>().DestY = (Team == TEAM.BLUE) ? League.Small.Defense.DefenderLineAction : League.Small.Defense.DefenderLineAction * -1;
                Defenders[0].GetComponent <RobotCarController>().DestX = Ball.transform.position.x;
                Forward[0].GetComponent <RobotCarController>().DestX   = Ball.transform.position.x;
                Forward[0].GetComponent <RobotCarController>().DestY   = Ball.transform.position.z;
                break;

            case 5:
                break;

            case 11:
                break;
            }
        }
    }
Пример #5
0
        public Computer(STRATEGY s)
        {
            switch (s)
            {
            case STRATEGY.EASY:
                strategy = new Easy();
                break;

            case STRATEGY.MEDIUM:
                strategy = new Medium();
                break;

            case STRATEGY.HARD:
                strategy = new Hard();
                break;
            }
        }
Пример #6
0
    public void ChangeStrat(STRATEGY strat)
    {
        if (player_instance)
        {
            if (player_instance.GetComponent <PlayerDetails>().selectedUnits.Count > 0)
            {
                foreach (EnemyBase unit in player_instance.GetComponent <PlayerDetails>().selectedUnits)
                {
                    if (!unit)
                    {
                        continue;
                    }

                    unit.strategy = strat;
                    Debug.Log(unit.strategy);
                }
            }
        }
    }
Пример #7
0
        private List<Double> averageConvergencePercent = new List<double>(); //saves the average convergence percent on each iteration of pageRank

        #endregion Fields

        #region Constructors

        public Pages(STRATEGY approach)
        {
            this.approach = approach;
        }