Exemplo n.º 1
0
    /// <summary>
    /// Банковские операции
    /// 514
    /// </summary>
    static void ShowBank(bool isFirst)
    {
        int ret = Functions.Bankrot;

        if (ret > 0)
        {
            TextWriter.ShowMsg(string.Format(Language.Bankrote, ret));
            Controller.GetStr(BackToMenu, false);
        }
        else
        {
            TextWriter.Clear();
            TextWriter.ShowMsg(Language.BankHello);
            Values.N1++;
            if (Values.S4 == 0)             //4
            {
                TextWriter.ShowMsg(Language.BankGivKr);
            }
            if (Values.K4 == 0)             //5
            {
                TextWriter.ShowMsg(Language.BankGetKr);
            }
            TextWriter.ShowMsg("? ");
            Controller.GetStr(BankNav, true);
        }
    }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var key = "";

            while (key != "Q")
            {
                Console.WriteLine("R for read, W for write, C for clear, Q for quit");
                key = Console.ReadLine();

                if (key == "R")
                {
                    Console.WriteLine();
                    Console.WriteLine();
                    Console.Write(_writer.ReadAll());
                    Console.WriteLine();
                    Console.WriteLine();
                }
                else if (key == "W")
                {
                    Console.WriteLine("Input line to write");
                    var line = Console.ReadLine();
                    _writer.WriteLine(line);
                }
                else if (key == "C")
                {
                    _writer.Clear();
                }
            }

            _writer.Dispose();
        }
Exemplo n.º 3
0
 static void PayFor(string pVal)
 {
     TextWriter.Clear();
     ShowHaveTxt(Values.E, Language.VCS, -1, Language.payfor);
     ShowHaveTxt(Values.D, Language.VDS, -1, Language.have);
     TextWriter.ShowMsg(Language.bill2, 0.5f);
     TextWriter.ShowMsg(Language.age);
     Controller.GetStr(AgeGotten, true);
 }
Exemplo n.º 4
0
//	static int m = 0;

    public static void StartGame()
    {
        Values.Init();

        TextWriter.Clear();
        TextWriter.ShowMsg(Language.gettime);
        Controller.GetStr(timeGotten, true);

        //ShowMainMenu (true);
    }
Exemplo n.º 5
0
 static void SayHello()
 {
     TextWriter.Clear();
     TextWriter.ShowMsg(Language.hello);
     TextWriter.ShowMsg(Language.hello2);
     TextWriter.ShowMsg("\n");
     TextWriter.ShowMsg(Language.canbe, 0.5f);
     ShowHaveTxt(Values.C, Language.VBS, -1, Language.have);
     Controller.GetStr(PayFor, true);
 }
Exemplo n.º 6
0
 static void ShowMainMenu(bool clear = true)
 {
     if (clear)
     {
         TextWriter.Clear();
     }
     ShowNal();
     TextWriter.ShowMsg("\n");
     TextWriter.ShowMsg(Language.MENU);
     Controller.GetStr(NavMenu1, true);
 }
Exemplo n.º 7
0
    static void ShowStat(bool navigate = true)
    {
        int total = Functions.CalcFinance();

        TextWriter.Clear();
        TextWriter.ShowMsg("\n");
        ShowNal();
        TextWriter.ShowMsg(string.Format(Language.stat, Values.A[1], Values.A1, Values.A[2], Values.A[3], Values.A[4]));
        TextWriter.ShowMsg("\n");
        TextWriter.ShowMsg(string.Format(Language.total, total));
        if (navigate)
        {
            TextWriter.ShowMsg("\n\n");
            Controller.GetStr(BackToMenu, false);
        }
    }
Exemplo n.º 8
0
    /// <summary>
    /// Азартные игры
    /// 840
    /// </summary>
    static void Games(bool isFirst)
    {
        Functions.ReCalcGames();
        ShowNal();
        Values.N1 += 5;
        TextWriter.Clear();
        TextWriter.ShowMsg(Language.GameHello, 0.5f, 0.003f, 0);
        for (int i = 0; i < 5; i++)
        {
            TextWriter.ShowMsg(Language.VDG[i] + "\t" + Values.R1[i].ToString().PadRight(10) + Values.R2[i].ToString().PadRight(10) + Values.R3[i] + "\n", 0, 0.003f);
        }

        TextWriter.ShowMsg("\n");
        TextWriter.ShowMsg(Language.WillBuy[8]);
        Controller.GetStr(GamePlays, true);
    }
Exemplo n.º 9
0
    static void ShowPersonel(bool isFirst)
    {
        TextWriter.Clear();
        ShowNal();
        if (isFirst)
        {
            Values.N1++;
            Functions.RecalcPersonel();
        }

        CategoryState state = Functions.ArrStat(Values.D);

        TextWriter.ShowMsg("\n");
        if (state != CategoryState.BUYONLY)
        {
            TextWriter.ShowMsg(Language.canSell[4]);
            for (int i = 0; i < 5; i++)
            {
                if (Values.D[i] == 1)
                {
                    TextWriter.ShowMsg(Language.VCS[i] + "\t\t\t" + (Values.D1[i] * 0.2f).ToString() + "\n");
                }
            }
        }

        TextWriter.ShowMsg("\n");
        if (state != CategoryState.SELLONLY)
        {
            TextWriter.ShowMsg(Language.canBuy[4]);
            for (int i = 0; i < 5; i++)
            {
                if (Values.D[i] == 0)
                {
                    TextWriter.ShowMsg(Language.VCS[i] + "\t\t\t" + Values.D1[i].ToString() + "\n");
                }
            }
        }

        TextWriter.ShowMsg("\n");
        TextWriter.ShowMsg(Language.WillBuy[curMenuFlag]);
        Controller.GetStr(WaitBuy, true);
    }
Exemplo n.º 10
0
    static void ShowFlat(bool first = false)
    {
        if (first)
        {
            Values.N1++;
            Functions.RecalcRealtyPrice();
        }
        TextWriter.Clear();
        TextWriter.ShowMsg("\n");
        ShowNal();
        CategoryState state = Functions.ArrStat(Values.C);

        if (state != CategoryState.BUYONLY)
        {
            TextWriter.ShowMsg(Language.canSell[3]);
            for (int i = 0; i < Values.C.Length; i++)
            {
                if (Values.C[i] == 1)
                {
                    TextWriter.ShowMsg(Language.VBS[i] + "\t\t\t" + Values.C2[i].ToString() + "\n");
                }
            }
        }
        TextWriter.ShowMsg("\n");
        if (state != CategoryState.SELLONLY)
        {
            TextWriter.ShowMsg(Language.canBuy[3]);
            for (int i = 0; i < Values.C.Length; i++)
            {
                if (Values.C[i] == 0)
                {
                    TextWriter.ShowMsg(Language.VBS[i] + "\t\t\t" + Values.C3[i].ToString() + "\n");
                }
            }
        }
        TextWriter.ShowMsg("\n");
        TextWriter.ShowMsg(Language.Expenses);
        TextWriter.ShowMsg("\n");
        TextWriter.ShowMsg(Language.WillBuy[curMenuFlag]);
        Controller.GetStr(WaitBuy, true);
    }
Exemplo n.º 11
0
    static void CashGotten(string pVAl)
    {
        int Y = 0;

        if (int.TryParse(pVAl, out Y))
        {
            TextWriter.Clear();
            if (Y > Values.MaxStartCash)
            {
                TextWriter.ShowMsg(Language.toomuch);
                Y = Values.MaxStartCash;
            }
            Values.A[0] = Y;
            ShowMainMenu(false);
        }
        else
        {
            TextWriter.ShowMsg(Language.cash);
            Controller.GetStr(CashGotten, true);
        }
    }
Exemplo n.º 12
0
 /// <summary>
 /// Страховка в банке
 /// 590
 /// </summary>
 /// <param name="pVal">P value.</param>
 static void BankStr(string pVal)
 {
     if (pVal == "1")
     {
         TextWriter.Clear();
         TextWriter.ShowMsg(Language.BankStr3);
         for (int i = 0; i < Values.C.Length; i++)
         {
             if (Values.C[i] == 1)
             {
                 TextWriter.ShowMsg(Language.VBS[i] + "\t\t\t" + Values.C2[i].ToString() + "\n");
             }
         }
         TextWriter.ShowMsg(Language.BankStr4);
         Controller.GetStr(bankStr2, true);
     }
     else
     {
         CheakNewYear();
     }
 }
Exemplo n.º 13
0
    /// <summary>
    /// Shows the stock
    /// 738
    /// </summary>
    static void ShowStock(bool isFirst)
    {
        if (isFirst)
        {
            Functions.ReCalcStock();
        }

        TextWriter.Clear();
        if (Values.N1 > Values.N4)
        {
            TextWriter.ShowMsg(Language.STClose);
            Controller.GetStr(CheakNewYear, false);
        }
        else
        {
            Values.N1++;
            if (!Accident())
            {
                ShowStock2();
            }
        }
    }
Exemplo n.º 14
0
    /// <summary>
    /// Показать бизнес
    /// 262
    /// </summary>
    static void ShowBusiness(bool isFirst)
    {
        TextWriter.Clear();
        ShowNal();
        TextWriter.ShowMsg("\n");
        if (isFirst)
        {
            Values.N1++;
            Functions.RecalcBusiness();
        }
        CategoryState state = Functions.ArrStat(Values.E);

        if (state != CategoryState.BUYONLY)
        {
            TextWriter.ShowMsg(Language.canSell[5]);
            for (int i = 0; i < 5; i++)
            {
                if (Values.E[i] == 1)
                {
                    TextWriter.ShowMsg(Language.VDS[i] + "\t\t" + Values.E2[i].ToString().PadRight(10) + "\t" + Values.E1[i] + "\n");
                }
            }
        }

        if (state != CategoryState.SELLONLY)
        {
            TextWriter.ShowMsg(Language.canBuy[5]);
            for (int i = 0; i < 5; i++)
            {
                if (Values.E[i] == 0)
                {
                    TextWriter.ShowMsg(Language.VDS[i] + "\t\t" + Values.E3[i].ToString().PadRight(10) + "\t" + Values.E1[i] + "\n");
                }
            }
        }
        TextWriter.ShowMsg("\n");
        TextWriter.ShowMsg(Language.WillBuy[curMenuFlag]);
        Controller.GetStr(WaitBuy, true);
    }
Exemplo n.º 15
0
    /// <summary>
    /// Общественное положение
    /// 616
    /// </summary>
    static void ShowObStat(bool isFirst)
    {
        TextWriter.Clear();
        TextWriter.ShowMsg("\n\n");
        if (Values.B3 != 0)
        {
            TextWriter.ShowMsg(Language.VybWas);
            Controller.GetStr(CheakNewYear, false);
        }
        else if (!Functions.VybYear)
        {
            Values.B3 = 1;
            TextWriter.ShowMsg(Language.VybNot);
            Controller.GetStr(CheakNewYear, false);
        }
        else
        {
            ShowNal();
            ShowHaveTxt(Values.B, Language.VAS, 1, Language.you);
            TextWriter.ShowMsg(Language.VybHello);

            VybDol = Functions.RecalcStat();

            if (VybDol == 4)
            {
                TextWriter.ShowMsg(Language.VybFin);
                Controller.GetStr(CheakNewYear, false);
            }
            else
            {
                TextWriter.ShowMsg(Language.VAS2[VybDol]);
                TextWriter.ShowMsg("\t\t\t" + Values.B1[VybDol].ToString() + "\t\t" + (Values.B2[VybDol] * 100).ToString() + "\n\n");
                TextWriter.ShowMsg(Language.Vyb);
                Controller.GetStr(Vyb, true);
            }
        }
    }