Exemplo n.º 1
0
        public Questor()
        {
            _lastPulse = DateTime.MinValue;

            _random = new Random();

            _salvage = new Salvage();
            _defense = new Defense();
            _combat = new Combat();
            _traveler = new Traveler();
            _unloadLoot = new UnloadLoot();
            _agentInteraction = new AgentInteraction();
            _arm = new Arm();
            _missionController = new MissionController();
            _drones = new Drones();
            _panic = new Panic();
            _storyline = new Storyline();

            Settings.Instance.SettingsLoaded += SettingsLoaded;

            // State fixed on ExecuteMission
            State = QuestorState.Idle;

            _directEve = new DirectEve();
            Cache.Instance.DirectEve = _directEve;

            _directEve.OnFrame += OnFrame;
        }
Exemplo n.º 2
0
 public GameController(IWriter writer)
 {
     this.writer            = writer;
     this.wareHouse         = new WareHouse();
     this.army              = new Army();
     this.missionController = new MissionController(this.army, this.wareHouse);
     this.soldiersFactory   = new SoldierFactory();
     this.missionFactory    = new MissionFactory();
 }
Exemplo n.º 3
0
 public GameController()
 {
     this.army              = new Army();
     this.wareHouse         = new WareHouse();
     this.missionfactory    = new MissionFactory();
     this.soldierFactory    = new SoldierFactory();
     this.missionController = new MissionController(this.army, this.wareHouse);
     this.output            = new StringBuilder();
 }
Exemplo n.º 4
0
    public void Enter()
    {
        List <GameObject> characters = MissionController.FindCharacters();

        MissionController.Characters = characters;
        MissionController.SecondTurn = new List <GameObject>(MissionController.Characters);
        MissionController.SetObjectives();
        MissionController.currentCharacter = MissionController.Characters[MissionController.Index];
    }
    void Start()
    {
        levelLoader = GetComponent <LevelLoader>();
        actualSate  = 0;
        leftButton.onClick.AddListener(Back);
        rightButton.onClick.AddListener(Next);

        missionController = GameObject.Find("MissionController").GetComponent <MissionController>();
    }
 public GameController()
 {
     this.army              = new Army();
     this.wearHouse         = new WareHouse();
     this.missionController = new MissionController(this.army, this.wearHouse);
     this.soldierFactory    = new SoldierFactory();
     this.ammunitionFactory = new AmmunitionFactory();
     this.missionFactory    = new MissionFactory();
 }
    public void MissionControllerDisplaysSuccessMessage()
    {
        var missionController = new MissionController(this.army, this.warehouse);

        var mission = new Easy(0);
        var result  = missionController.PerformMission(mission);


        Assert.IsTrue(result.StartsWith("Mission completed - Suppression of civil rebellion"));
    }
    public void TestMissionsInQueue()
    {
        IArmy      army              = new Army();
        IWareHouse wareHouse         = new Warehouse();
        var        missionController = new MissionController(army, wareHouse);

        IMission mission = new Easy(20);

        Assert.AreEqual(missionController.PerformMission(mission).Trim(), "Mission on hold - Suppression of civil rebellion");
    }
 public GameController(IWriter writer, IArmy army, IWareHouse wareHouse, MissionController missionController,
                       ISoldierFactory soldierFactory, IMissionFactory missionFactory)
 {
     this.writer            = writer;
     this.army              = army;
     this.wareHouse         = wareHouse;
     this.missionController = missionController;
     this.soldierFactory    = soldierFactory;
     this.missionFactory    = missionFactory;
 }
Exemplo n.º 10
0
    public void PerformMissionIsSucceess()
    {
        IMission          mission    = new Easy(0);
        IArmy             army       = new Army();
        IWareHouse        wareHouse  = new WareHouse();
        MissionController controller = new MissionController(army, wareHouse);
        string            result     = controller.PerformMission(mission);

        Assert.IsTrue(result.StartsWith("Mission completed"));
    }
Exemplo n.º 11
0
 //Called when the player presses space within a cube
 public void StartMission(GameObject missionCube)
 {
     if (!takenMission)
     {
         MissionController mcs = missionCube.GetComponent <MissionController>();
         minimapController.TakeMission(missionCube);
         takenMission = true;
         timerController.AddTime(mcs.time);
     }
 }
    public void CtorShouldInitialiazeCorrectProperties()
    {
        // Act
        this.missionController = new MissionController(this.army, this.wareHouse);

        // Assert
        Assert.AreEqual(0, this.missionController.FailedMissionCounter, "Incorrect FailedMissionCounter!");
        Assert.AreEqual(0, this.missionController.SuccessMissionCounter, "Incorrect SuccessMissionCounter!");
        Assert.AreEqual(0, this.missionController.Missions.Count, "Incorrect Missions count!");
    }
    public void FailedMissionShouldReturnMissionOnHoldMessage()
    {
        this.mission           = new Easy(1);
        this.missionController = new MissionController(new Army(), this.wareHouse);

        string result = this.missionController
                        .PerformMission(this.mission);

        Assert.True(result.StartsWith("Mission on hold"));
    }
Exemplo n.º 14
0
 void Start()
 {
     upgradeSliders = GetComponent <UpgradeSliderController> ();
     playerShooting = GameObject.Find("Player").GetComponent <PlayerShooting> ();
     playerMovement = GameObject.Find("Player").GetComponent <PlayerMovement> ();
     missions       = GetComponent <MissionController> ();
     upgradeSliders.SetupSlider(attackSpeedUpgrade * upgradeAmount, "atk");
     upgradeSliders.SetupSlider(damageUpgrade * upgradeAmount, "dmg");
     upgradeSliders.SetupSlider(movementSpeedUpgrade * upgradeAmount, "move");
 }
Exemplo n.º 15
0
    void OnTriggerExit(Collider other)
    {
        HeliController temp = other.gameObject.GetComponentInChildren <HeliController>();

        if (temp != null)
        {
            canAcceptMission = false;
            MissionController.HideMissionAcceptPanel();
        }
    }
Exemplo n.º 16
0
    public void CreatingControllerWithEmptyArmy()
    {
        //Arrange
        this.sut = new MissionController(null, new WareHouse());

        //Act

        //Assert
        Assert.Throws <NullReferenceException>(() => this.sut.PerformMission(new Easy(10)));
    }
Exemplo n.º 17
0
    public void CreatingControllerWithNullParametersBlowsUpWhenUsed()
    {
        //Arrange
        this.sut = new MissionController(null, null);

        //Act

        //Assert
        Assert.Throws <NullReferenceException>(() => this.sut.PerformMission(new Easy(100)));
    }
Exemplo n.º 18
0
    private void Awake()
    {
        instance = this;

        //-------Mission Example--------
        //------------------Mission 1-----------------
        //AddMission("Ondas","Voce tera que fazer mais de 1000 pontos pegando uma onda!",new List<float>(){1000});

        //-----------------Mission 2-----------------
        //AddMission("Dirigir","Dirija 500m com o seu carro",new List<float>(){500});
    }
Exemplo n.º 19
0
 public GameController(IWareHouse wareHouse, IArmy army, MissionController missionController, ISoldierFactory soldiersFactory,
                       IAmmunitionFactory ammunitionFactory, IMissionFactory missionFactory)
 {
     this.wareHouse         = wareHouse;
     this.army              = army;
     this.missionController = missionController;
     this.soldiersFactory   = soldiersFactory;
     this.ammunitionFactory = ammunitionFactory;
     this.missionFactory    = missionFactory;
     this.result            = new StringBuilder();
 }
Exemplo n.º 20
0
    void OnTriggerEnter(Collider other)
    {
        HeliController temp = other.gameObject.GetComponentInChildren <HeliController>();

        if (temp != null)
        {
            canAcceptMission = true;
            string bestTimeString = GetBestTimeString();
            MissionController.ShowMissionAcceptPanel(missionTitle, bestTimeString, missionDescription, idealHelicopter.ToString());
        }
    }
Exemplo n.º 21
0
    void Start()
    {
        Tapsell.initialize("hitinfajfertkdptqjtkqrrfoqrqpignnaaqgitqcdpbcqgskbjdsladrsbddgecniiotk");
        persian = Persian;
        english = English;
        if (restart)
        {
            PlayerPrefs.DeleteAll();
        }
        else
        {
            missionController = GetComponent <MissionController>();
            DontDestroyOnLoad(gameObject);
            if (PlayerPrefs.GetInt("FirstTime") == 0)
            {
                stateData     = new StateData();
                currencyData  = new CurrencyData();
                characterData = new CharacterData();
                characterData.charcaterIds = new List <int>();
                characterData.GurdianIds   = new List <int>();
                characterData.levels       = new List <Level>();
                characterData.charcaterIds.Add(1);
                characterData.GurdianIds.Add(1);
                characterData.charcaterId = 1;
                characterData.GurdianId   = 1;
                characterData.levels.Add(new Level(1));
                SetCharacterLevel(1);
                stateData.hadBoughtFirstOffer = false;
                stateData.lvl     = 0;
                stateData.EXP     = 0;
                stateData.GoldGet = DateTime.Now;
                missionController.MakeMission();

                saveCharacter();
                saveCurrency();
                saveState();
                PlayerPrefs.SetInt("Meat", 0);
                PageName = "Entro";
                PlayerPrefs.SetString("Language", "Persian");
            }
            else
            {
                PlayerPrefs.SetInt("Meat", 1);
                LoadCharacter();
                LoadCurrency();
                LoadState();
                SetCharacterLevel(characterData.charcaterId);

                missionController.LoadMission();

                PageName = "MainMenu";
            }
        }
    }
Exemplo n.º 22
0
 void Awake()
 {
     if (!instance)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Exemplo n.º 23
0
    public GameController(IArmy army, IWareHouse wareHouse, ISoldierFactory soldierFactory, IMissionFactory missionFactory, MissionController missionController, IWriter writer)
    {
        this.Army      = army;
        this.WareHouse = wareHouse;
        this.missionControllerField = missionController;
        this.soldierFactory         = soldierFactory;
        this.missionFactory         = missionFactory;
        this.writer = writer;

        this.sb = new StringBuilder();
    }
Exemplo n.º 24
0
 public GameController(ISoldierController soldierController, SoldierFactory soldiersFactory, AmmunitionFactory ammunitionFactory, IOutputGiver outputGiver, Army army, IWareHouse wareHouse, MissionController missionControllerField, MissionFactory missionFactory)
 {
     this.soldierController = soldierController;
     this.soldiersFactory   = soldiersFactory;
     this.ammunitionFactory = ammunitionFactory;
     this.missionFactory    = missionFactory;
     this.outputGiver       = outputGiver;
     Army      = army;
     WareHouse = wareHouse;
     MissionControllerField = missionControllerField;
 }
Exemplo n.º 25
0
    public void MissionControllerShouldDisplaySuccessMessage()
    {
        var army              = new Army();
        var wareHouse         = new WareHouse();
        var missionController = new MissionController(army, wareHouse);

        var    mission = new Easy(0);
        string result  = missionController.PerformMission(mission);

        Assert.IsTrue(result.StartsWith("Mission completed - Suppression of civil rebellion"));
    }
Exemplo n.º 26
0
        void Update()
        {
            currentMission = gameManager.missionState;

            if (currentMission == MissionController.FinalMission) {
                GetComponent<Light> ().enabled = true;

            } else {
                GetComponent<Light> ().enabled = false;
            }
        }
 public void CancelButton()
 {
     //Debug.Log("Cancel the mission");
     GameObject.Find("DialogBox").GetComponent <TweenPosition>().PlayReverse();
     GameObject.Find("DialogBox").transform.Find("AcceptButton").gameObject.SetActive(false);
     GameObject.Find("DialogBox").transform.Find("CancelButton").gameObject.SetActive(false);
     MissionController.CancelTheMission(NPCName, NPCDialogList[0]);
     IsFinish        = true;
     FirstTimeToRead = true;
     CallReset();
     Player.GetComponent <BasicMove>().SetControllable(true);
 }
        public void MissionCtrollerDisplaysSuccessMessage()
        {
            var army              = new Army();
            var wareHourse        = new WareHouse();
            var missionController = new MissionController(army, wareHourse);

            var    mission = new Easy(0);
            string result  = result = missionController.PerformMission(mission);


            Assert.IsTrue(result.StartsWith("Mission completed"));
        }
Exemplo n.º 29
0
 // Use this for initialization
 void Start()
 {
     playerTarget = GameObject.FindGameObjectWithTag("ShipTargeter").transform;
     GameObject[] enemiesArray = GameObject.FindGameObjectsWithTag("EnemyShip");
     missionController = GameObject.FindGameObjectWithTag("MissionController").GetComponent<MissionController>();
     enemies = new List<GameObject>();
     foreach (GameObject enemy in enemiesArray)
     {
         enemies.Add(enemy);
         enemy.GetComponent<AI_Controller>().target = playerTarget;
     }
 }
Exemplo n.º 30
0
    public void MissionControllerDisplaysSuccessMessage()
    {
        var army              = new Army();
        var wareHouse         = new WareHouse();
        var missionController = new MissionController(army, wareHouse);

        var mission = new Easy(0);

        var res = missionController.PerformMission(mission);

        Assert.IsTrue(res.StartsWith("Mission completed - Suppression of civil"));
    }
Exemplo n.º 31
0
    public GameController(IWareHouse wareHouse, IAmmunitionFactory ammunitionFactory, ISoldierFactory soldierFactory, IArmy army, IMissionFactory missionFactory, IWriter writer)
    {
        this.wareHouse         = wareHouse;
        this.ammunitionFactory = ammunitionFactory;
        this.soldierFactory    = soldierFactory;
        this.army           = army;
        this.missionFactory = missionFactory;

        this.writer = writer;

        this.missionControllerField = new MissionController(army, this.wareHouse);
    }
    public void MissionControllerDisplaysSuccessMessage()
    {
        var army      = new Army();
        var warehouse = new WareHouse(new AmmunitionFactory());

        var missionController = new MissionController(army, warehouse);

        var    mission = new Easy(0);
        string result  = missionController.PerformMission(mission);

        Assert.IsTrue(result.Contains("Mission completed - Suppression of civil rebellion"));
    }
 public GameController()
 {
     this.army      = new Dictionary <string, List <ISoldier> >();
     this.wearHouse = new Dictionary <string, List <IAmmunition> >();
     this.armyClass = new Army();
     this.wareHouse = new WareHouse();
     this.missionControllerField = new MissionController(armyClass, wareHouse);
     this.ammoFactory            = new AmmunitionFactory();
     this.soldiersFactory        = new SoldierFactory();
     this.soldierController      = new SoldierController();
     this.missionFactory         = new MissionFactory();
 }
Exemplo n.º 34
0
    public static void Main()
    {
        IArmy             army       = new Army();
        IWareHouse        wareHouse  = new WareHouse();
        MissionController controller = new MissionController(army, wareHouse);

        IGameController interpreter = new GameController(controller, army, wareHouse);
        IReader         reader      = new ConsoleReader();
        IWriter         writer      = new ConsoleWriter();
        var             engine      = new Engine(interpreter, reader, writer);

        engine.Run();
    }
Exemplo n.º 35
0
        public GenericCombatStoryline()
        {
            _neededAmmo = new List<Ammo>();

            _agentInteraction = new AgentInteraction();
            _arm = new Arm();
            _traveler = new Traveler();
            _combat = new Combat();
            _drones = new Drones();
            _salvage = new Salvage();
            _missionController = new MissionController();

            Settings.Instance.SettingsLoaded += ApplySettings;
        }
Exemplo n.º 36
0
    //private static readonly int ACCUMULATE = 0;

    public MissionStatus(int owner)
    {
        Battle.MissionDefinition[] list;
        controller = GameObject.FindWithTag("GameController").GetComponent<MissionController>();
        this.owner = owner;
        buildings = new Dictionary<Storage.BuildingTypes, uint[]>();
        units = new Dictionary<Storage.UnitTypes, uint[]>();
        //resources = new Dictionary<WorldResources.Type, uint[]>();
        GameInformation info = GameObject.Find("GameInformationObject").GetComponent<GameInformation>();
        list = info.GetBattle().GetMissions().ToArray();
        foreach (Battle.MissionDefinition mission in list)
        {
            switch (mission.target)
            {
                case Storage.EntityType.UNIT:
                    if (!units.ContainsKey(mission.targetType.unit))
                    {
                        units.Add(mission.targetType.unit, new uint[2]);
                    }
                    switch (mission.purpose)
                    {
                        case Battle.MissionType.DESTROY:
                            units[mission.targetType.unit][0] = mission.amount;
                            break;
                        case Battle.MissionType.NEW:
                            units[mission.targetType.unit][1] = mission.amount;
                            break;
                    }
                    break;
                case Storage.EntityType.BUILDING:
                    if (!buildings.ContainsKey(mission.targetType.building))
                    {
                        buildings.Add(mission.targetType.building, new uint[2]);
                    }
                    switch (mission.purpose)
                    {
                        case Battle.MissionType.DESTROY:
                            buildings[mission.targetType.building][0] = mission.amount;
                            break;
                        case Battle.MissionType.NEW:
                            buildings[mission.targetType.building][1] = mission.amount;
                            break;
                    }
                    break;
            }
        }
    }
Exemplo n.º 37
0
 // Use this for initialization
 void Start()
 {
     mController = GameObject.Find("MissionController").GetComponent<MissionController>();
 }
Exemplo n.º 38
0
        public Questor(frmMain form1)
        {
            m_Parent = form1;
            _lastPulse = DateTime.MinValue;

            _random = new Random();

            //_debugmodule = new DebugModule();

            //_scoop = new Scoop();
            _salvage = new Salvage();
            _defense = new Defense();
            _localwatch = new LocalWatch();
            _scanInteraction = new ScanInteraction();
            _combat = new Combat();
            _traveler = new Traveler();
            _unloadLoot = new UnloadLoot();
            _agentInteraction = new AgentInteraction();
            _arm = new Arm();
            _courier = new CourierMission();
            _switch = new SwitchShip();
            _missionController = new MissionController();
            _drones = new Drones();
            _panic = new Panic();
            _storyline = new Storyline();

            Settings.Instance.SettingsLoaded += SettingsLoaded;

            // State fixed on ExecuteMission
            State = QuestorState.Idle;

            _directEve = new DirectEve();
            Cache.Instance.DirectEve = _directEve;

            Cache.Instance.StopTimeSpecified = Program.stopTimeSpecified;
            Cache.Instance.MaxRuntime = Program.maxRuntime;
            Cache.Instance.StopTime = Program._stopTime;
            _questorStarted = DateTime.Now;

            _directEve.OnFrame += OnFrame;
        }
 void Awake()
 {
     if (instance == null) {
         instance = this;
         missionController = new MissionController(missionType);
     }
     else if (instance != this)
         Destroy (this.gameObject);
 }
        void Update()
        {
            if (gameManager.gameState != GameState.NullState) {
                missionState = gameManager.missionState;
            }

            switch (missionState) {

            case MissionController.Default:
                SetDawn ();
                SetSun (350);
                break;

            case MissionController.TutorialMission:
                SetDay (0.6f); //early morning
                SetSun (45);
                break;

            case MissionController.CatMission:
                SetDay (0.6f); //mid-day
                SetSun (90);
                break;

            case MissionController.BoxesMission:
                SetDusk (0.6f); //mid afternoon
                SetSun (160);
                break;

            case MissionController.HorsesMission:
                SetDusk (0.5f); //mid afternoon
                SetSun (160);
                break;

            case MissionController.FinalMission:
                SetNight ();
                SetSun (270);
                break;

            default:
                SetDay (1);
                break;

            }
            // Perform standard updates:
            UpdateFog ();
        }
Exemplo n.º 41
0
 public void SetMission(MissionController.Mission mission)
 {
     m_name.text = mission.name;
     m_mission = mission;
 }
 /// Initializes working variables and performs starting calculations.  
 void Initialize()
 {
     gameManager = GameObject.Find ("Follow Camera").GetComponent<GmaeManage> ();
     missionState = gameManager.missionState;
     mapCentre = GameObject.Find ("Centre of Map").transform;
     sun = GetComponent<Light> ();
 }
 // Use this for initialization
 void Start()
 {
     missionController = GameObject.FindGameObjectWithTag("MissionController").GetComponent<MissionController>();
 }
Exemplo n.º 44
0
 void Start()
 {
     missionController = GameObject.FindObjectOfType<MissionController>();
     switch (ai_type)
     {
         case AI_Types.FlyBy:
             ai_state = AI_States.Hunting;
             break;
         case AI_Types.Assassin:
             ai_state = AI_States.Waiting;
             break;
         case AI_Types.Vulture:
             ai_state = AI_States.Waiting;
             break;
         default:
             break;
     }
     attacking = false;
 }