private static void PrintGambleInfo(this Entity player, string text, GambleType type)
        {
            switch (type)
            {
            case GambleType.Good:
                player.GamblerText(text, new Vector3(1, 1, 1), new Vector3(0, 1, 0), 1, 0.85f);
                Function.SetEntRef(-1);
                Function.Call("iprintln", player.Name + " gambled - ^2" + text);
                break;

            case GambleType.Bad:
                player.GamblerText(text, new Vector3(1, 1, 1), new Vector3(1, 0, 0), 1, 0.85f);
                Function.SetEntRef(-1);
                Function.Call("iprintln", player.Name + " gambled - ^1" + text);
                break;

            case GambleType.Excellent:
                player.GamblerText(text, new Vector3(1, 1, 1), new Vector3(1, 1, 0), 1, 0.85f);
                Function.SetEntRef(-1);
                Function.Call("iprintln", player.Name + " gambled - ^3" + text);
                break;

            case GambleType.Terrible:
                player.GamblerText(text, new Vector3(0, 0, 0), new Vector3(1, 1, 1), 1, 0);
                Function.SetEntRef(-1);
                Function.Call("iprintln", player.Name + " gambled - ^0" + text);
                break;
            }
        }
Beispiel #2
0
        private void PrintGambleInfo(Entity player, string text, GambleType type)
        {
            switch (type)
            {
            case GambleType.Good:
                player.GamblerText(text, new Vector3(1, 1, 1), new Vector3(0, 1, 0), 1, 0.85f);
                Utility.Println(player.Name + " gambled - ^2" + text);
                break;

            case GambleType.Bad:
                player.GamblerText(text, new Vector3(1, 1, 1), new Vector3(1, 0, 0), 1, 0.85f);
                Utility.Println(player.Name + " gambled - ^1" + text);
                break;

            case GambleType.Excellent:
                player.GamblerText(text, new Vector3(1, 1, 1), new Vector3(1, 1, 0), 1, 0.85f);
                Utility.Println(player.Name + " gambled - ^3" + text);
                break;

            case GambleType.Terrible:
                player.GamblerText(text, new Vector3(0, 0, 0), new Vector3(1, 1, 1), 1, 0);
                Utility.Println(player.Name + " gambled - ^0" + text);
                break;
            }
        }
Beispiel #3
0
 private void Play()
 {
     Player[] players = new Player[20];
     for (int i = 0; i < 10; i++)
     {
         players[i] = PlayerBuilder.Instance().Build(GambleType.values()[i]);
     }
     for (int i = 0; i < 10; i++)
     {
         players[i + 10] = PlayerBuilder.Instance().Build(GambleType.values()[i]);
     }
     for (int i = 0; i < players.Length; i++)
     {
         Console.WriteLine("===========================");
         players[i].Show();
         for (int j = i; j < players.Length; j++)
         {
             Player winner = players[i].WhoIsWinner(players[j]);
             Console.WriteLine("-------------------");
             Console.WriteLine(players[i]);
             Console.WriteLine(players[j]);
             if (winner == null)
             {
                 Console.WriteLine("EMPATE!!!");
             }
             else
             {
                 Console.WriteLine("GANADOR: " + winner);
             }
         }
     }
 }
Beispiel #4
0
 /// <summary>
 /// Constructor used when the user specifies a time.
 /// </summary>
 /// <param name="time">The time as selected by the user.</param>
 /// <param name="amount">The amount as given by the user.</param>
 /// <param name="type">The type as selected by the user.</param>
 /// <param name="description">The description as given by the user.</param>
 /// <param name="isOnlineGamble">Whether the gambled happened online, as given by the user.</param>
 public Gamble(DateTime time, string amount, GambleType type, string description, bool isOnlineGamble)
     : this(amount, type, description, isOnlineGamble)
 {
     if (time > DateTime.Now)
     {
         throw new ArgumentException(Text.GambleTimeInFuture);
     }
     Time = time.ToUniversalTime();
 }
Beispiel #5
0
 /// <summary>
 /// Constructor used when the user doesn't specify a time.
 /// </summary>
 /// <param name="amount">The amount as put in by the user.</param>
 /// <param name="type">The type as selected by the user.</param>
 /// <param name="description">The description as given by the user.</param>
 /// <param name="isOnlineGamble">Whether the gambled happened online, as given by the user.</param>
 public Gamble(string amount, GambleType type, string description, bool isOnlineGamble) : base(amount)
 {
     Type           = type;
     Description    = description;
     IsOnlineGamble = isOnlineGamble;
 }
Beispiel #6
0
 public virtual Player Build(GambleType gambleType)
 {
     return(builderMap[gambleType].Build());
 }