Esempio n. 1
0
 public override void EndTurn()
 {
     isReady = false;
     Reset();
     hasntDoneFirstMove = true;
     TestGameModel.PlayerDone();
 }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        m_view  = GetComponent <TestGameView>();
        m_model = GetComponent <TestGameModel>();

        m_view.AddBtnEvent(OnButtonClick);
        m_model.m_event = m_view.UpdateEvent;
        ModelInit();
    }
Esempio n. 3
0
    void Awake()
    {
        m_view  = GetComponent <TestGameView>();
        m_model = GetComponent <TestGameModel>();
        if (null == m_view)
        {
            Utility.LogWarning("view is null");
        }

        if (null == m_model)
        {
            Utility.LogWarning("model is null");
        }
    }
Esempio n. 4
0
 public void run()
 {
     try {
         TestGameModel theGame = new TestGameModel();
         Console.WriteLine("TestGetterAndSetter1 - score1: {0}", theGame.score);
         theGame.score = -1;
         Console.WriteLine("TestGetterAndSetter1 - score2: {0}", theGame.score);
         theGame.score = 55;
         Console.WriteLine("TestGetterAndSetter1 - score3: {0}", theGame.score);
     }
     catch (Exception cause) {
         Console.WriteLine("Error on test: {0}", cause);
     }
 }
Esempio n. 5
0
    /// <summary>
    /// Mainline method: Loads the file and extracts the data using a BinaryFortmatter
    /// </summary>
    /// <returns>If said load attempt was successfull, return true</returns>
    public static bool Load()
    {
        //Either the folder or file dont exist, return false to show a failed attempt.
        if (!FolderExists() || !File.Exists(filePath))
        {
            return(false);
        }
        using (FileStream fs = new FileStream(filePath, FileMode.Open)) {
            BinaryFormatter formatter = new BinaryFormatter();
            SaveData        data      = formatter.Deserialize(fs) as SaveData;
            //Using the same logic, we desearlise the information from the file into the class.
            Debug.Log("Load Successfull");

            //We then feed in the newrly aquired information to restart the game.
            GameManagercs.allPlayers = TestManager.ins.allPlayers = TestGameModel.StartNewGame(data, TestManager.ins.piecePrefab);
            TestGameModel.GetNextTurn(TestManager.ins.allPlayers, TestManager.ins.turnText);
            return(true);
        }
    }
 public void TurnStarted()
 {
     isReady = false;
     TestGameModel.GetNextTurn(allPlayers, turnText);
 }
 public void OnStartEvent()
 {
     allPlayers = TestGameModel.StartNewGame(modeSelection[selection.value].players, piecePrefab);
     TestGameModel.GetNextTurn(allPlayers, turnText);
 }
Esempio n. 8
0
 public override void EndTurn()
 {
     TestGameModel.PlayerDone();
 }