コード例 #1
0
ファイル: Program.cs プロジェクト: Alexeymos/SportRent
 static void InintArr()
 {
     baseinventory[0] = new Economicgames("Monopoly", 10, "Game on Board", "Economy", 4, 2);
     baseinventory[1] = new Logicgames("Chess", 12, "Game on Board", "Logic", "wood", "plastic");
     baseinventory[2] = new Bowls("MadBall", 20, "Game on street", "on floor", 10, "wood");
     baseinventory[3] = new Tenis("FunyBalls", 25, "Game on street", "on table", "USA", "China");
 }
コード例 #2
0
    public void Cook()
    {
        Potato potato = GetPotato();

        Peel(potato);
        Cut(potato);

        Carrot carrot = GetCarrot();

        Peel(carrot);
        Cut(carrot);

        Bowls bowl = GetBowl();

        bowl.Add(carrot);
        bowl.Add(potato);
    }
コード例 #3
0
        void ExecuteRoll(int parameter)
        {
            int mn = Bowls[parameter].Minimum;
            int mx = Bowls[parameter].Maximum;
            int n  = rnd.Next(mn, mx + 1);

            if (parameter > 0)
            {
                n = Math.Min(Bowls[parameter - 1], n);
                Bowls[parameter - 1].Increment(-n);
            }
            Bowls[parameter].Increment(n);
            if (parameter == _Bowls.Count - 1)
            {
                Cycles++;
                Throughput = 1.0 * Bowls.Last().Value / Cycles;
                Profit     = Throughput - Inventory / 10000.0;
            }
            Inventory = Bowls.Reverse().Skip(1).Sum(x => x.Value);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: Alexeymos/SportRent
        static void AddArr()
        {
            BaseInventory[] newbasinventory = new BaseInventory[baseinventory.Length + 1];
            for (int i = 0; i < baseinventory.Length; i++)
            {
                newbasinventory[i] = baseinventory[i];
            }
            baseinventory = newbasinventory;//
            while (true)
            {
                Console.Clear();
                char[] arr = new char[28] {
                    '+', '-', '-', '-', '-', '-', '-', '-', '-', '-', 'A', 'd', 'd', ' ', 'm', 'e', 'n', 'u', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+'
                };
                for (int i = 0; i < 28; i++)
                {
                    Console.Write(arr[i]);
                    Thread.Sleep(50);
                    Console.SetCursorPosition(i + 1, 0);
                }
                Console.WriteLine();
                StringBuilder sb = new StringBuilder();
                sb.Append("| 1- "); sb.Append((Menuprint)0); sb.AppendLine("              |");
                sb.Append("| 2- "); sb.Append((Menuprint)1); sb.AppendLine("                 |");
                sb.Append("| 3- "); sb.Append((Menuprint)2); sb.AppendLine("                 |");
                sb.Append("| 4- "); sb.Append((Menuprint)3); sb.AppendLine("                 |");
                sb.AppendLine("| 5- Exit                  |");
                sb.AppendLine("+--------------------------+");
                Console.WriteLine(sb);
                string choice = Console.ReadLine();
                Console.Clear();
                switch (choice)
                {
                case "1":
                    BaseInventory ecogame = new Economicgames();
                    ecogame.AddInventry();
                    baseinventory[baseinventory.Length - 1] = ecogame;
                    break;

                case "2":
                    BaseInventory logicgame = new Logicgames();
                    logicgame.AddInventry();
                    baseinventory[baseinventory.Length - 1] = logicgame;
                    break;

                case "3":
                    BaseInventory Bowls = new Bowls();
                    Bowls.AddInventry();
                    baseinventory[baseinventory.Length - 1] = Bowls;
                    break;

                case "4":
                    BaseInventory Ping = new Tenis();
                    Ping.AddInventry();
                    baseinventory[baseinventory.Length - 1] = Ping;
                    break;

                case "5":
                    break;
                }
                break;
            }
        }
コード例 #5
0
 public void ScoreAll()
 {
     Bowls.ForEach(x => x.Score(_scoreBowl));
 }