示例#1
0
        private void ScoreBoard_Load(object sender, EventArgs e)
        {
            label10.Text = aPlayer.GetTotalNumberOfSteps().ToString();
            label11.Text = bPlayer.GetTotalNumberOfSteps().ToString();
            label12.Text = cPlayer.GetTotalNumberOfSteps().ToString();
            label13.Text = dPlayer.GetTotalNumberOfSteps().ToString();

            label18.Text = aPlayer.GetTotalAmountOfGoldSpent().ToString();
            label19.Text = bPlayer.GetTotalAmountOfGoldSpent().ToString();
            label20.Text = cPlayer.GetTotalAmountOfGoldSpent().ToString();
            label21.Text = dPlayer.GetTotalAmountOfGoldSpent().ToString();

            label14.Text = aPlayer.GetTotalAmountOfGoldEarned().ToString();
            label15.Text = bPlayer.GetTotalAmountOfGoldEarned().ToString();
            label16.Text = cPlayer.GetTotalAmountOfGoldEarned().ToString();
            label17.Text = dPlayer.GetTotalAmountOfGoldEarned().ToString();

            label22.Text    = aPlayer.GetPlayerGold().ToString();
            label23.Text    = bPlayer.GetPlayerGold().ToString();
            label24.Text    = cPlayer.GetPlayerGold().ToString();
            label25.Text    = dPlayer.GetPlayerGold().ToString();
            ALog.DataSource = aPlayer.GetLog();
            BLog.DataSource = bPlayer.GetLog();
            CLog.DataSource = cPlayer.GetLog();
            DLog.DataSource = dPlayer.GetLog();

            aPlayer.WriteToFile(map.GetMapString());
            bPlayer.WriteToFile(map.GetMapString());
            cPlayer.WriteToFile(map.GetMapString());
            dPlayer.WriteToFile(map.GetMapString());
        }
示例#2
0
        private void Tm_Tick(object sender, EventArgs e)
        {
            switch (map.GetGameOrder())
            {
            case 1:
                if (aPlayer.IsDeath() == true)
                {
                    map.RemovePlayersIsDeath(map.GetGameOrder());
                    map.SetGameOrder();
                    siradaki.Text = GameOrderString(map.GetGameOrder());
                    PlayerDeathPictureDraw(aPlayer);
                    aPlayer.SetPlayerMapValue(aPlayer.GetLastCord()[0], aPlayer.GetLastCord()[1], 0);
                    GraphicDraw();
                    ALog.Items.Clear();
                    for (int i = aPlayer.GetLog().Count - 1; i >= 0; i--)
                    {
                        ALog.Items.Add(aPlayer.GetLog()[i]);
                    }
                    break;
                }
                aPlayer.Move(map);
                aPlayerKasa.Text = aPlayer.GetPlayerGold().ToString();
                if (aPlayer.IsDeath() == true)
                {
                    map.RemovePlayersIsDeath(map.GetGameOrder());
                    map.SetGameOrder();
                    siradaki.Text = GameOrderString(map.GetGameOrder());
                    PlayerDeathPictureDraw(aPlayer);
                    aPlayer.SetPlayerMapValue(aPlayer.GetLastCord()[0], aPlayer.GetLastCord()[1], 0);
                    GraphicDraw();
                    ALog.Items.Clear();
                    for (int i = aPlayer.GetLog().Count - 1; i >= 0; i--)
                    {
                        ALog.Items.Add(aPlayer.GetLog()[i]);
                    }
                    break;
                }
                GraphicDraw();
                ALog.Items.Clear();
                for (int i = aPlayer.GetLog().Count - 1; i >= 0; i--)
                {
                    ALog.Items.Add(aPlayer.GetLog()[i]);
                }
                map.SetGameOrder();
                siradaki.Text = GameOrderString(map.GetGameOrder());
                break;

            case 2:
                if (bPlayer.IsDeath() == true)
                {
                    map.RemovePlayersIsDeath(map.GetGameOrder());
                    map.SetGameOrder();
                    siradaki.Text = GameOrderString(map.GetGameOrder());
                    PlayerDeathPictureDraw(bPlayer);
                    bPlayer.SetPlayerMapValue(bPlayer.GetLastCord()[0], bPlayer.GetLastCord()[1], 0);
                    GraphicDraw();
                    BLog.Items.Clear();
                    for (int i = bPlayer.GetLog().Count - 1; i >= 0; i--)
                    {
                        BLog.Items.Add(bPlayer.GetLog()[i]);
                    }
                    break;
                }
                bPlayer.Move(map);
                bPlayerKasa.Text = bPlayer.GetPlayerGold().ToString();
                if (bPlayer.IsDeath() == true)
                {
                    map.RemovePlayersIsDeath(map.GetGameOrder());
                    map.SetGameOrder();
                    siradaki.Text = GameOrderString(map.GetGameOrder());
                    PlayerDeathPictureDraw(bPlayer);
                    bPlayer.SetPlayerMapValue(bPlayer.GetLastCord()[0], bPlayer.GetLastCord()[1], 0);
                    GraphicDraw();
                    BLog.Items.Clear();
                    for (int i = bPlayer.GetLog().Count - 1; i >= 0; i--)
                    {
                        BLog.Items.Add(bPlayer.GetLog()[i]);
                    }
                    break;
                }
                GraphicDraw();
                BLog.Items.Clear();
                for (int i = bPlayer.GetLog().Count - 1; i >= 0; i--)
                {
                    BLog.Items.Add(bPlayer.GetLog()[i]);
                }
                map.SetGameOrder();
                siradaki.Text = GameOrderString(map.GetGameOrder());
                break;

            case 3:
                if (cPlayer.IsDeath() == true)
                {
                    map.RemovePlayersIsDeath(map.GetGameOrder());
                    map.SetGameOrder();
                    siradaki.Text = GameOrderString(map.GetGameOrder());
                    PlayerDeathPictureDraw(cPlayer);
                    cPlayer.SetPlayerMapValue(cPlayer.GetLastCord()[0], cPlayer.GetLastCord()[1], 0);
                    GraphicDraw();
                    CLog.Items.Clear();
                    for (int i = cPlayer.GetLog().Count - 1; i >= 0; i--)
                    {
                        CLog.Items.Add(cPlayer.GetLog()[i]);
                    }
                    break;
                }
                cPlayer.Move(map);
                cPlayerKasa.Text = cPlayer.GetPlayerGold().ToString();
                if (cPlayer.IsDeath() == true)
                {
                    map.RemovePlayersIsDeath(map.GetGameOrder());
                    map.SetGameOrder();
                    siradaki.Text = GameOrderString(map.GetGameOrder());
                    PlayerDeathPictureDraw(cPlayer);
                    cPlayer.SetPlayerMapValue(cPlayer.GetLastCord()[0], cPlayer.GetLastCord()[1], 0);
                    GraphicDraw();
                    CLog.Items.Clear();
                    for (int i = cPlayer.GetLog().Count - 1; i >= 0; i--)
                    {
                        CLog.Items.Add(cPlayer.GetLog()[i]);
                    }
                    break;
                }
                GraphicDraw();
                CLog.Items.Clear();
                for (int i = cPlayer.GetLog().Count - 1; i >= 0; i--)
                {
                    CLog.Items.Add(cPlayer.GetLog()[i]);
                }
                map.SetGameOrder();
                siradaki.Text = GameOrderString(map.GetGameOrder());
                break;

            case 4:
                if (dPlayer.IsDeath() == true)
                {
                    map.RemovePlayersIsDeath(map.GetGameOrder());
                    map.SetGameOrder();
                    siradaki.Text = GameOrderString(map.GetGameOrder());
                    PlayerDeathPictureDraw(dPlayer);
                    dPlayer.SetPlayerMapValue(dPlayer.GetLastCord()[0], dPlayer.GetLastCord()[1], 0);
                    GraphicDraw();
                    DLog.Items.Clear();
                    for (int i = dPlayer.GetLog().Count - 1; i >= 0; i--)
                    {
                        DLog.Items.Add(dPlayer.GetLog()[i]);
                    }
                    break;
                }
                dPlayer.Move(map);
                dPlayerKasa.Text = dPlayer.GetPlayerGold().ToString();
                if (dPlayer.IsDeath() == true)
                {
                    map.RemovePlayersIsDeath(map.GetGameOrder());
                    map.SetGameOrder();
                    siradaki.Text = GameOrderString(map.GetGameOrder());
                    PlayerDeathPictureDraw(dPlayer);
                    dPlayer.SetPlayerMapValue(dPlayer.GetLastCord()[0], dPlayer.GetLastCord()[1], 0);
                    GraphicDraw();
                    DLog.Items.Clear();
                    for (int i = dPlayer.GetLog().Count - 1; i >= 0; i--)
                    {
                        DLog.Items.Add(dPlayer.GetLog()[i]);
                    }
                    break;
                }
                GraphicDraw();
                DLog.Items.Clear();
                for (int i = dPlayer.GetLog().Count - 1; i >= 0; i--)
                {
                    DLog.Items.Add(dPlayer.GetLog()[i]);
                }
                map.SetGameOrder();
                siradaki.Text = GameOrderString(map.GetGameOrder());
                break;

            default:
                break;
            }

            if (map.GetgameOver() == true)
            {
                tm.Stop();
                MessageBox.Show(map.GetgameOverReason() + " Oyun bitti.");
                aPlayer.SetLog(map.GetgameOverReason());
                bPlayer.SetLog(map.GetgameOverReason());
                cPlayer.SetLog(map.GetgameOverReason());
                dPlayer.SetLog(map.GetgameOverReason());
                aPlayer.SetLog("Oyun Bitti");
                bPlayer.SetLog("Oyun Bitti");
                cPlayer.SetLog("Oyun Bitti");
                dPlayer.SetLog("Oyun Bitti");
                ScoreBoard scoreBoard = new ScoreBoard(aPlayer, bPlayer, cPlayer, dPlayer, map, this);
                scoreBoard.Show();
            }
        }