예제 #1
0
        public void CheckGetTeamAtPostionFirst()
        {
            SoccerTeam t1 = new SoccerTeam("CFR Cluj", 35);
            SoccerTeam t2 = new SoccerTeam("FCSB", 31);
            SoccerTeam t3 = new SoccerTeam("U Craiova", 32);
            SoccerTeam t4 = new SoccerTeam("Dinamo", 24);
            SoccerTeam t5 = new SoccerTeam("FC Vaslui", 36);

            SoccerTeam[] teams = new SoccerTeam[] { t1, t2, t3, t4, t5 };

            GeneralRanking ranking = new GeneralRanking(teams);

            Assert.Equal(t5, ranking.GetTeamAtPostion(1));
        }
예제 #2
0
        public void CheckAddNewTeam()
        {
            SoccerTeam t1 = new SoccerTeam("CFR Cluj", 36);
            SoccerTeam t2 = new SoccerTeam("FCSB", 31);
            SoccerTeam t3 = new SoccerTeam("U Craiova", 32);
            SoccerTeam t4 = new SoccerTeam("Dinamo", 24);
            SoccerTeam t5 = new SoccerTeam("Astra Giurgiu", 25);

            SoccerTeam[] teams = new SoccerTeam[] { t1, t2, t3, t4 };

            GeneralRanking ranking = new GeneralRanking(teams);

            ranking.AddTeam(t5);

            Assert.Equal(4, ranking.GetTeamPosition(t5));
        }
예제 #3
0
        public void CheckUpdateTeamPointsWithDrawValue()
        {
            SoccerTeam t1 = new SoccerTeam("CFR Cluj", 35);
            SoccerTeam t2 = new SoccerTeam("FCSB", 32);
            SoccerTeam t3 = new SoccerTeam("U Craiova", 31);
            SoccerTeam t4 = new SoccerTeam("Dinamo", 24);
            SoccerTeam t5 = new SoccerTeam("FC Vaslui", 36);

            SoccerTeam[] teams = new SoccerTeam[] { t1, t2, t3, t4, t5 };

            GeneralRanking ranking = new GeneralRanking(teams);

            ranking.UpdateTeamPoints(t3, t4, 2, 2);

            Assert.Equal(4, ranking.GetTeamPosition(t3));
        }
예제 #4
0
        public void CheckAlreadySortedRanking()
        {
            SoccerTeam t1 = new SoccerTeam("CFR Cluj", 36);
            SoccerTeam t2 = new SoccerTeam("FCSB", 34);
            SoccerTeam t3 = new SoccerTeam("U Craiova", 32);
            SoccerTeam t4 = new SoccerTeam("Dinamo", 31);
            SoccerTeam t5 = new SoccerTeam("FC Vaslui", 24);

            SoccerTeam[] teams = new SoccerTeam[] { t1, t2, t3, t4, t5 };

            GeneralRanking ranking = new GeneralRanking(teams);

            ranking.UpdateTeamPoints(t4, t5, 0, 2);

            Assert.Equal(5, ranking.GetTeamPosition(t5));
        }
예제 #5
0
    void OnEnable()
    {
        allStats    = new List <Stat>();
        playerMoney = new PlayerMoney(true);

        Satisfaction.Init();
        Comfortableness.Init();
        GeneralRanking.Init();
        Hunger.Init();
        Social.Init();
        Study.Init();



        WorldLimitedUseInteractable.onInteractUse += deductStamina;
        LocationHandler.OnTurnEnd += resetStamina;

        DateTimeSystem.OnMonthChange += clearMonthBudget;
    }