Exemplo n.º 1
0
    // Use this for initialization
    void Awake()
    {
        Debug.Assert(SaveGameEventSubscription == null && AutoSaveGameEventSubscription == null);
        SaveGameEventSubscription= MessageHub.Subscribe<SaveGameEvent>(SaveGame);
        AutoSaveGameEventSubscription = MessageHub.Subscribe<AutoSaveGameEvent>(AutoSaveGame);

        mapData = new CollectedMapData();

        space = GameObject.Find("Space").GetComponent<Space>();
        if (space == null)
        {
            throw new MissingComponentException("Unable to find Space. The big bang doesn't have enough space to happen. The 'Space' game object also needs to be added to the level and have the space script attached.");
        }

        airTrafficControl = GameObject.Find("AirTrafficControl").GetComponent<AirTrafficControl>();
        if (space == null)
        {
            throw new MissingComponentException("Unable to find AirTrafficControl. There can't be any troops flying around without an global AirTrafficControl GameObject that has an AirTrafficControl Script attached.");
        }

        gameState = GameObject.Find("2D_MainCam").GetComponent<GameState>();
        if (gameState == null)
        {
            throw new MissingComponentException("Unable to find GameState. The 'GameState' script needs to be attached to the same Gameobject as the BigBang.");
        }
        playerManager = GameObject.Find("PlayerManagement").GetComponent<PlayerManager>();
        if (playerManager == null)
        {
            throw new MissingComponentException("Unable to find playerManager.");
        }
    }
Exemplo n.º 2
0
        static async Task Main()
        {
            IAirTrafficControl mehrabadAirTrafficControl = new AirTrafficControl();

            AirplaneBase airbusAirplane = new AirbusAirplane(mehrabadAirTrafficControl);
            AirplaneBase boeingAirplane = new BoeingAirplane(mehrabadAirTrafficControl);

            mehrabadAirTrafficControl.AddAirplanes(airbusAirplane, boeingAirplane);

            airbusAirplane.Send("Can we land right now ?");
            Console.WriteLine("----------");

            boeingAirplane.Send("No! We're landing, wait ...");
            Console.WriteLine("----------");

            // Demonstrate landing ...
            Console.WriteLine("Boeing is landing ...");
            await Task.Delay(TimeSpan.FromSeconds(3));

            Console.WriteLine("----------");

            boeingAirplane.Send("We landed.");
            Console.WriteLine("----------");

            airbusAirplane.Send("OK, We're going to land ...");
            Console.WriteLine("----------");

            boeingAirplane.Send("Good luck.");

            Console.ReadKey();
        }
Exemplo n.º 3
0
    private void Start()
    {
        //Spawn the nodes
        SpawnNodes();

        //Once all the nodes are added, init the Air Traffic Controller
        AirTrafficControl atc = GetComponent <AirTrafficControl>();

        atc.InitController();
    }
Exemplo n.º 4
0
    public void Seeking(GameObject landingPadToArriveAt, int returnCode, AirTrafficControl controller)
    {
        //Save our return code.
        this.returnCode = returnCode;
        this.controller = controller;

        //Store our landing pad.
        landingPad = landingPadToArriveAt;

        // Get our landing pad location and store it in another variable as well for leaving.
        targetLocation     = landingPad.transform.position;// + new Vector3(0.0f, 1.0f, 0.0f);
        landingPadLocation = targetLocation;

        // Go to that node.
        state = ShipState.Moving;
    }
Exemplo n.º 5
0
        public static void Main(string[] args)
        {
            var airTrafficControl = new AirTrafficControl();

            var fighter1 = new Junkers("JC123", airTrafficControl);
            var fighter2 = new Lancaster("LA456", airTrafficControl);
            var fighter3 = new Mustang("MS789", airTrafficControl);
            var fighter4 = new Spitfire("SF3121", airTrafficControl);
            var fighter5 = new Stuka("ST6059", airTrafficControl);

            fighter1.Altitude += 25000;
            fighter2.Altitude += 25000;
            fighter3.Altitude += 25000;
            fighter4.Altitude += 25000;
            fighter5.Altitude += 25000;

            Console.ReadLine();
        }
Exemplo n.º 6
0
    // ****                     **** //
    void Awake()
    {
        space = GameObject.Find("Space").GetComponent<Space>();
        if (space == null) {
            throw new MissingComponentException("Unable to find Space. The big bang doesn't have enough space to happen. The 'Space' game object also needs to be added to the level and have the space script attached.");
        }

        airTrafficControl = GameObject.Find("AirTrafficControl").GetComponent<AirTrafficControl>();
        if (airTrafficControl == null) {
            throw new MissingComponentException("Unable to find AirTrafficControl. There can't be any troops flying around without an global AirTrafficControl GameObject that has an AirTrafficControl Script attached.");
        }

        gameState = gameObject.GetComponent<GameState>();
        if (gameState == null) {
            throw new MissingComponentException("Unable to find GameState. The 'GameState' script needs to be attached to the same Gameobject as the BigBang.");
        }

        playerManager = GameObject.Find("PlayerManagement").GetComponent<PlayerManager>();
        if (playerManager == null) {
            throw new MissingComponentException("Unable to find PlayerManager. This script has to be attached to the global PlayerManagement game object.");
        }
    }
Exemplo n.º 7
0
 public override void Send(string message)
 {
     Console.WriteLine("Airbus airplane sends message: " + message);
     AirTrafficControl.SendMessage(message, this);
 }
Exemplo n.º 8
0
 public void JustUtil()
 {
     var atc    = new AirTrafficControl();
     var plane1 = new Boeing737200("WS203", atc);
     var plane2 = new Airbus321("AC159", atc);
 }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.Clear();
            Console.ForegroundColor = ConsoleColor.White;

            BaseCommander     A = new BaseCommander();
            AirTrafficControl B = new AirTrafficControl();
            Crew           C    = new Crew();
            LoadTeamChief  D    = new LoadTeamChief();
            Driver         E    = new Driver();
            Driver         E2   = new Driver();
            RampController F    = new RampController();
            Handler        H    = new Handler();

            Console.WriteLine("The beginning of the mission: The commander states his needs.\n");
            Thread.Sleep(2000);
            A.Brief();
            Thread.Sleep(2000);
            D.Salute();
            Thread.Sleep(1500);
            A.ReturnSalute();
            Thread.Sleep(2000);

            Console.WriteLine("The Team Cheif gets his crew\n");
            Thread.Sleep(2000);
            D.Brief();
            Thread.Sleep(2000);

            Console.WriteLine("The Load team prepares the load \n");
            H.BuildPallet();
            Thread.Sleep(2000);
            E.GetVehicleForklift();
            Thread.Sleep(2000);
            E.LoadForkLift();
            Thread.Sleep(2000);
            E2.GetVehicleKLoader();
            Thread.Sleep(2000);
            E.LoadKLoader();
            Thread.Sleep(2000);
            E2.DriveToFlightLine();
            Thread.Sleep(2000);

            Console.WriteLine("The Load team loadsv the pallet \n");
            Thread.Sleep(2000);
            F.ArriveAtAirCraft();
            D.ReceiveMessage();
            Thread.Sleep(2000);
            F.RequestOpenDoor();
            Thread.Sleep(2000);
            C.OpenAirCraftDoor();
            Thread.Sleep(2000);
            E2.ApproachAirCraft();
            Thread.Sleep(2000);
            F.StartLoad();
            Thread.Sleep(2000);
            D.ReceiveMessage();
            Thread.Sleep(2000);
            H.PushPallet();
            Thread.Sleep(2000);
            H.TieDownPallet();
            Thread.Sleep(2000);
            F.NotifyCrew();
            Thread.Sleep(2000);
            C.InspectLoad();
            Thread.Sleep(2000);
            C.ApproveLoad();
            Thread.Sleep(2000);
            F.EndLoad();
            Thread.Sleep(2000);
            D.ReceiveMessage();
            Thread.Sleep(2000);
            F.DismissLoadTeam();
            Thread.Sleep(2000);
            C.StartAirCraftEngines();
            Thread.Sleep(2000);

            Console.WriteLine("The AirCraft Departs.\n");
            C.RequestTakeOff();
            Thread.Sleep(2000);
            B.ApproveTakeoff();
            Thread.Sleep(2000);
            C.TakeOff();
            Thread.Sleep(2000);
            F.CallDeparture();
            Thread.Sleep(2000);
            D.ReceiveMessage();
            Thread.Sleep(2000);
            B.Brief();
            Thread.Sleep(2000);

            Console.WriteLine("==========================================MISSION COMPLETE===========================================");
        }