Ejemplo n.º 1
0
        public void TestWriteJson()
        {
            //Arrange
            var    rw            = new OlcSideScrollingConsoleGame.Core.ReadWrite();
            string Path          = "\\Resources\\Settings";
            string FileName      = "\\settings";
            string FileExtension = ".json";

            // highscore

            var HSO = new HighScoreObj()
            {
                //Id = 1,
                Handle = "AAA",
                //Hours = 0,
                //Minutes = 5,
                //Seconds = 2,
                //Time = "00:05:02:123"
            };
            var HSOList = new List <HighScoreObj>();

            HSOList.Add(HSO);

            var testObj = new SettingsObj()
            {
                //misc = "Unit test",
                //AttributeIndex = new int[3] { 1, 2, 4 }
                //HighScoreList = HSOList
            };

            //Act
            var success = rw.WriteJson <SettingsObj>(Path, FileName, FileExtension, testObj);

            //Assert
            Assert.IsTrue(success);
        }
Ejemplo n.º 2
0
 public void PutOnHighScore(HighScoreObj HSO)
 {
     HighScoreList.Add(HSO);
     HighScoreList = HighScoreList.OrderBy(x => x.TimeSpan).ThenBy(y => y.DateTime).Take(5).ToList();
 }
Ejemplo n.º 3
0
 void Awake()
 {
     myTransform    = this.transform;
     score_text     = ScoreObj.GetComponentInChildren <Text>();
     highScore_text = HighScoreObj.GetComponentInChildren <Text>();
 }