예제 #1
0
        public void TestForWorldMapButtonResultWhenBetweenNoOfWorldAndProgress()
        {
            WorldMapImplementation worldMapImplementor = new WorldMapImplementation();
            int result = worldMapImplementor.DeclareWorldButtonsLogic(1, 4, 1, 2);

            Assert.AreEqual(2, result);
        }
예제 #2
0
        public void TestForWorldMapButtonResultWhenLargerThanProgressAndNoOfWorld()
        {
            WorldMapImplementation worldMapImplementor = new WorldMapImplementation();
            int result = worldMapImplementor.DeclareWorldButtonsLogic(1, 4, 1, 5);

            Assert.AreEqual(0, result);
        }
예제 #3
0
        public void TestForProcessWorldInformation()
        {
            List <Tuple <int, string> > worldNames = new List <Tuple <int, string> >();
            Tuple <int, string>         x          = new Tuple <int, string>(1, "world1");
            Tuple <int, string>         y          = new Tuple <int, string>(2, "world2");

            worldNames.Add(x);
            worldNames.Add(y);
            WorldMapImplementation worldMapImplementor = new WorldMapImplementation();

            worldMapImplementor.ProcessWorldInformation(worldNames);
            Assert.AreEqual(2, worldMapImplementor.GetWorldCount());
        }
예제 #4
0
        public void TestForProcessUserProgressLogicWhenWorldCountIsLesserThanProgress()
        {
            List <Tuple <int, int, string> > worldStageProgress = new List <Tuple <int, int, string> >();
            Tuple <int, int, string>         x = new Tuple <int, int, string>(1, 1, "80");
            Tuple <int, int, string>         y = new Tuple <int, int, string>(2, 1, "100");

            worldStageProgress.Add(x);
            worldStageProgress.Add(y);
            WorldMapImplementation worldMapImplementor = new WorldMapImplementation();

            worldMapImplementor.SetWorldCount(1);
            worldMapImplementor.ProcessUserProgressLogic(worldStageProgress);
            Assert.AreEqual(1, worldMapImplementor.GetWorldProgress());
        }
예제 #5
0
    //Load world data from database and initialize the map
    async void Start()
    {
        datahandler = GameObject.Find("DataManager").GetComponent <DataHandler>();

        this.pageNumber     = 1;
        worldMapImplementor = new WorldMapImplementation();

        await GetWorldAndUserProgressFromDatabase();

        GameObject loadingCircle = GameObject.Find("LoadingCircle");

        loadingCircle.SetActive(false);

        UpdateLeftRightButtons();
    }