Example #1
0
    public ScenarioStdData activeScenario = new ScenarioStdData();  //currently selected scenario (for 2-5)

    private void Awake()
    {
        //Initialise Components
        routeManager        = GetComponent <RouteManager>();
        checkpointManager   = GetComponent <CheckpointManager>();
        intersectionManager = GetComponent <IntersectionManager>();
        player           = GameObject.FindGameObjectWithTag("Player");
        playerController = player.GetComponent <PlayerController>();
        gameManager      = FindObjectOfType <GameManager>().GetComponent <GameManager>();
        hotspotManager   = FindObjectOfType <GameManager>().GetComponent <HotspotManager>();
        uIManager        = FindObjectOfType <GameManager>().GetComponent <UIManager>();

        // Import data session from GlobalControl
        //selectedScenario = GlobalControl.instance.activeSequence;
        // selectedRoute = GlobalControl.instance.activeRoute;
        //sessionData = GlobalControl.instance.sessionData;   // isGroupSession, groupID, studentIDs, isSender //TODO: Move to gameManager

        importPath = Path.Combine(Directory.GetCurrentDirectory(), "Assets/Media/Text/");
        ImportAllTextFiles();   //Import text files containing

        //IMPORT SCENARIOS DATA FROM TEXT FILES
        scenario1S0Data = ImportScenario1Data(scenario1S0TextFile, hotspotManager.hotspotTextS0, 2); //Scenario 1
        scenario1S6Data = ImportScenario1Data(scenario1S6TextFile, hotspotManager.hotspotTextS6, 2); //Scenario 6
        scenario2Data   = ImportScenarioStdData(scenario2TextFile, 2);                               //Scenario 2
        scenario3Data   = ImportScenarioStdData(scenario3TextFile, 2);                               //Scenario 3
        scenario4Data   = ImportScenarioStdData(scenario4TextFile, 2);                               //Scenario 4
        scenario5Data   = ImportScenarioStdData(scenario5TextFile, 2);                               // Scenario 5
    }
Example #2
0
        protected void btnIntersect_Clicked(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                IntersectionManager <decimal> mgr = new IntersectionManager <decimal>(new Cube.Calculations.DecimalCalculator());

                decimal res = mgr.GetIntersectionVolumeOfCubes(
                    decimal.Parse(cbfrmCubeA.Size),
                    decimal.Parse(cbfrmCubeA.X),
                    decimal.Parse(cbfrmCubeA.Y),
                    decimal.Parse(cbfrmCubeA.Z),
                    decimal.Parse(cbfrmCubeB.Size),
                    decimal.Parse(cbfrmCubeB.X),
                    decimal.Parse(cbfrmCubeB.Y),
                    decimal.Parse(cbfrmCubeB.Z));

                if (res != decimal.MinValue)
                {
                    ltlResults.Text = String.Format("Cubes intersect and the intersected volume is: {0}", res);
                }
                else
                {
                    ltlResults.Text = String.Format("Cubes do not intersect", res);
                }
            }
        }
Example #3
0
 private void Awake()
 {
     gameManager         = FindObjectOfType <GameManager>().GetComponent <GameManager>();
     routeManager        = FindObjectOfType <GameManager>().GetComponent <RouteManager>();
     UIManager           = FindObjectOfType <GameManager>().GetComponent <UIManager>();
     intersectionManager = FindObjectOfType <GameManager>().GetComponent <IntersectionManager>();
     checkpointManager   = FindObjectOfType <GameManager>().GetComponent <CheckpointManager>();
 }
Example #4
0
        private IntersectionManager SetupIntersectionManager(WordEntry existing, WordEntry candidate)
        {
            var sut = new IntersectionManager(NullLogger <IntersectionManager> .Instance);

            sut.Soup = soup;
            sut.Check(existing, candidate);
            return(sut);
        }
Example #5
0
 void Awake()
 {
     // Initialise components
     gameManager          = FindObjectOfType <GameManager>().GetComponent <GameManager>();
     uiManager            = FindObjectOfType <GameManager>().GetComponent <UIManager>();
     routeManager         = FindObjectOfType <GameManager>().GetComponent <RouteManager>();
     intersectionManager  = FindObjectOfType <GameManager>().GetComponent <IntersectionManager>();
     lastHotspotCollected = 0; //
 }
Example #6
0
 /// <summary>
 /// Update this HurtableSprite.
 /// </summary>
 /// <param name="i_GameTime">Game time.</param>
 public override void Update(GameTime i_GameTime)
 {
     base.Update(i_GameTime);
     if (HurtInCase.HasFlag(eHurtInCase.Touch))
     {
         IntersectionManager intersectionManager = GameScreen.Services.GetService(typeof(IntersectionManager)) as IntersectionManager;
         intersectionManager.CheckAndActForIntersection(this);
     }
 }
Example #7
0
 // Start is called before the first frame update
 void Awake() // BUG if not setting to Awake. Why? Global Control?
 {
     // Initialise components
     gameManager             = FindObjectOfType <GameManager>().GetComponent <GameManager>();
     uiManager               = FindObjectOfType <GameManager>().GetComponent <UIManager>();
     routeManager            = FindObjectOfType <GameManager>().GetComponent <RouteManager>();
     intersectionManager     = FindObjectOfType <GameManager>().GetComponent <IntersectionManager>();
     saveSessionData         = GetComponent <SaveSessionData>();
     lastCheckpointCollected = 0; //
 }
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Example #9
0
    // Start is called before the first frame update
    void Awake()
    {
        gameManager         = FindObjectOfType <GameManager>().GetComponent <GameManager>();
        uiManager           = FindObjectOfType <GameManager>().GetComponent <UIManager>();
        intersectionManager = FindObjectOfType <GameManager>().GetComponent <IntersectionManager>();
        routeManager        = GetComponent <RouteManager>();
        canvas = FindObjectOfType <Canvas>();
        player = GameObject.FindGameObjectWithTag("Player");

        savePath = Path.Combine(gameManager.screenshotPath, "/all/");
        //currentRouteDir = routeDir2;
    }
Example #10
0
    public bool validationCheck = false;   //whether route is being validated - used for UI display only

    private void Awake()
    {
        // Initialise GameObjects and components
        player = GameObject.FindGameObjectWithTag("Player");
        intersectionManager = GetComponent <IntersectionManager>();
        routeManager        = GetComponent <RouteManager>();
        playerController    = player.GetComponent <PlayerController>();
        gameManager         = GetComponent <GameManager>();

        // Initialise UI elements
        goto_Btn.onClick.AddListener(GotoBtnHandler);
        debugCanvas.enabled = false;  //Enable the UI
    }
Example #11
0
    //public bool cameraTilt = true;

    private void Awake()
    {
        // _controls = new PlayerControl();
        playerCamera        = Camera.main; //Set playerCamera to camera with 'main'tag
        playerRb            = GetComponent <Rigidbody>();
        gameManager         = FindObjectOfType <GameManager>().GetComponent <GameManager>();
        intersectionManager = FindObjectOfType <GameManager>().GetComponent <IntersectionManager>();
        uiManager           = FindObjectOfType <GameManager>().GetComponent <UIManager>();
        sequenceManager     = FindObjectOfType <GameManager>().GetComponent <SequenceManager>();
        routeManager        = FindObjectOfType <GameManager>().GetComponent <RouteManager>();
        screenshotManager   = FindObjectOfType <GameManager>().GetComponent <ScreenshotManager>();
        checkpointManager   = FindObjectOfType <GameManager>().GetComponent <CheckpointManager>();
        hotspotManager      = FindObjectOfType <GameManager>().GetComponent <HotspotManager>();
        saveSessionData     = FindObjectOfType <GameManager>().GetComponent <SaveSessionData>();
    }
Example #12
0
        /// <summary>
        /// Stage screen constructor.
        /// </summary>
        /// <param name="i_ScreensManager">Screen manager.</param>
        /// <param name="i_Level">Level of stage.</param>
        /// <param name="i_Spaceships">Spaceships array.</param>
        private StageScreen(ScreensManager i_ScreensManager, int i_Level, Spaceship[] i_Spaceships)
            : base(i_ScreensManager, @"Backgrounds\BG_Space01_1024x768")
        {
            m_level      = i_Level;
            m_spaceships = i_Spaceships;
            IntersectionManager intersectionManager = new IntersectionManager(this);

            Services.AddService(typeof(IntersectionManager), intersectionManager);
            if (s_animationsManager == null)
            {
                s_animationsManager = new AnimationsManager();
                addDyingAnimation();
            }

            Services.AddService(typeof(AnimationsManager), s_animationsManager);
        }
Example #13
0
    void Awake()
    {
        routeManager        = GetComponent <RouteManager>();
        checkpointManager   = GetComponent <CheckpointManager>();
        intersectionManager = GetComponent <IntersectionManager>();
        player           = GameObject.FindGameObjectWithTag("Player");
        playerController = player.GetComponent <PlayerController>();
        gameManager      = FindObjectOfType <GameManager>().GetComponent <GameManager>();
        hotspotManager   = FindObjectOfType <GameManager>().GetComponent <HotspotManager>();
        uIManager        = FindObjectOfType <GameManager>().GetComponent <UIManager>();
        sequenceManager  = FindObjectOfType <GameManager>().GetComponent <SequenceManager>();

        filePath = Path.Combine(Directory.GetCurrentDirectory(), "Exports/SessionsData/"); //For macOS, Linux

        if (!System.IO.Directory.Exists(filePath))                                         //if save directory does not exist, create it
        {
            System.IO.Directory.CreateDirectory(filePath);
        }

        routeCoord = new List <string>();
    }
Example #14
0
    public bool overideOnIntersectionExit; //Using when resetting route manually

    // Start is called before the first frame update
    private void Awake()
    {
        // Initialise GameObjects and components
        player              = GameObject.FindGameObjectWithTag("Player");
        playerController    = player.GetComponent <PlayerController>();
        intersectionManager = GetComponent <IntersectionManager>();
        routeManager        = GetComponent <RouteManager>();
        sequenceManager     = GetComponent <SequenceManager>();
        uiManager           = GetComponent <UIManager>();
        checkpointManager   = GetComponent <CheckpointManager>();
        saveSessionData     = GetComponent <SaveSessionData>();

        overideOnIntersectionExit = false;

        sessionData = GlobalControl.instance.sessionData;          // Import data session from GlobalControl
        Debug.Log("GAME MANAGER (pause): " + sessionData.sessionPaused);

        SetPaths();                     // Set paths for importing and exporting data
        InitialiseSession();            // Initialise variables for session start

        //Debug.Log("(gamemanager) Distance: " + sessionDistance);
    }
Example #15
0
        protected void btnIntersect_Clicked(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                IntersectionManager<decimal> mgr = new IntersectionManager<decimal>(new Cube.Calculations.DecimalCalculator());

                decimal res = mgr.GetIntersectionVolumeOfCubes(
                    decimal.Parse(cbfrmCubeA.Size),
                    decimal.Parse(cbfrmCubeA.X),
                    decimal.Parse(cbfrmCubeA.Y),
                    decimal.Parse(cbfrmCubeA.Z),
                    decimal.Parse(cbfrmCubeB.Size),
                    decimal.Parse(cbfrmCubeB.X),
                    decimal.Parse(cbfrmCubeB.Y),
                    decimal.Parse(cbfrmCubeB.Z));

                if (res != decimal.MinValue)
                    ltlResults.Text = String.Format("Cubes intersect and the intersected volume is: {0}", res);
                else
                    ltlResults.Text = String.Format("Cubes do not intersect", res);
            }
        }
Example #16
0
        /// <summary>
        /// Update the bullet on game space.
        /// </summary>
        /// <param name="i_GameTime">Game time.</param>
        public override void Update(GameTime i_GameTime)
        {
            if (SelfTeam == eTeam.Player)
            {
                m_selfLocation.Y -= (float)i_GameTime.ElapsedGameTime.TotalSeconds * sr_movementSpeed;
                if (m_selfLocation.Y <= 0)
                {
                    Destroy(0);
                }
            }
            else
            {
                m_selfLocation.Y += (float)i_GameTime.ElapsedGameTime.TotalSeconds * sr_movementSpeed;
                if (m_selfLocation.Y >= Game.Window.ClientBounds.Height)
                {
                    Destroy(0);
                }
            }

            IntersectionManager intersectionManager = GameScreen.Services.GetService(typeof(IntersectionManager)) as IntersectionManager;

            intersectionManager.CheckAndActForIntersection(this);
        }
Example #17
0
 private void Start()
 {
     interM = IntersectionManager.instance;
 }
Example #18
0
	void Start() {
		intersection = transform.parent.GetComponent<IntersectionManager>();
		if (intersection == null) {
			Debug.LogError(string.Format ("Finish line {0} doesn't have a parent intersection", this));
		}
	}