Ejemplo n.º 1
0
 public void AddTextTest()
 {
     TwoServerWindow target = new TwoServerWindow(); // TODO: Initialize to an appropriate value
     string toAdd = string.Empty; // TODO: Initialize to an appropriate value
     target.AddText(toAdd);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor, must have a twoserver and time till round finishes 
 /// </summary>
 /// <param name="twoServer"></param>
 /// <param name="timeToEvent"></param>
 public LightMasterEvent(TwoServerWindow twoServer, float timeToEvent)
     : base(twoServer, timeToEvent)
 {
     TwoServer = twoServer;
     TimeToEvent = timeToEvent;
     Type = "LIGHTMASTER";
 }
Ejemplo n.º 3
0
 public override Boolean Execute(TwoServerWindow twoServer, Player player, string[] cardArgs)
 {
     foreach (Player p in twoServer.PlayerList.PlayerArray)
     {
             twoServer.SendDrinkForm(p, 10, "KABLAM, BOOM, BANG!!111one");
     }
     twoServer.DownDeck.Push(this);
     twoServer.PlayerList.RemovePlayerCard(player, this);
     twoServer.SendPlayerCards(player);
     twoServer.PlayerList.NextPlayer(1);
     twoServer.SendToAllPlayers("TOPCARD " + SortValue);
     return true;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// When card is played, this method should be called with the player being the player who used the card
 /// </summary>
 /// <param name="twoServer">For access to various class variables</param>
 /// <param name="player">Player who out down the card</param>
 /// <param name="cardArgs">Arguments for the card</param>
 /// <returns>If card plays successfully should be true</returns>
 public virtual Boolean Execute(TwoServerWindow twoServer, Player player, string[] cardArgs)
 {
     twoServer.DownDeck.Push(this);
     twoServer.PlayerList.RemovePlayerCard(player, this);
     twoServer.SendPlayerCards(player);
     int t = (int) ((SortValue*100)%10);
     if( twoServer.DrinkLevel == 2)
     {
         switch(t)
         {
             case 1:
                 twoServer.SendDrinkForm(player,3, "One for me!");
                 twoServer.SendAnnounce(String.Format("{0}: One for me", player.Name));
                 break;
             case 2:
                 foreach (Player p in twoServer.PlayerList.PlayerArray)
                 {
                     if( p != player)
                         twoServer.SendPlayerDrinks(p, 2);
                 }
                 twoServer.SendAnnounce(String.Format("{0}: Two for you!", player.Name));
                 break;
             case 3:
                 foreach (Player p in twoServer.PlayerList.PlayerArray)
                 {
                     if (p.PlayerNumber%2 == 1)
                         twoServer.SendDrinkForm(p, 3, "Odds Drink!");
                 }
                 twoServer.SendAnnounce(String.Format("{0}: Three is odd", player.Name));
                 break;
             case 4:
                 foreach (Player p in twoServer.PlayerList.PlayerArray)
                 {
                     if (p.PlayerNumber % 2 == 0)
                         twoServer.SendDrinkForm(p, 3, "Evens Drink!");
                 }
                 twoServer.SendAnnounce(String.Format("{0}: Four is even", player.Name));
                 break;
             case 5:
                 Player victim = twoServer.PlayerList.GetRandomPlayer();
                 twoServer.SendAnnounce("Random drinks for " + victim.Name);
                 twoServer.SendToAllPlayers("TIMEDFORM 6 " + victim.PlayerNumber + " Randomly punished by " + player.Name);
                 break;
         }
     }
     twoServer.PlayerList.NextPlayer(1);
     twoServer.SendToAllPlayers("TOPCARD " + SortValue);
     return true;
 }
Ejemplo n.º 5
0
 public override Boolean Execute(TwoServerWindow twoServer, Player player, string[] cardArgs)
 {
     twoServer.DownDeck.Push(this);
     twoServer.PlayerList.RemovePlayerCard(player, this);
     twoServer.SendPlayerCards(player);
     twoServer.PlayerList.NextPlayer(1);
     twoServer.SendToAllPlayers("TOPCARD " + SortValue);
     twoServer.PlayerList.LightMaster = player.PlayerNumber;
     twoServer.SendAnnounce(player.Name + " just became the lightmaster!");
     twoServer.PlayerList.LastLight = 0;
     return true;
 }
Ejemplo n.º 6
0
 public void TwoServerWindowConstructorTest()
 {
     TwoServerWindow target = new TwoServerWindow();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Ejemplo n.º 7
0
 public override Boolean Execute(TwoServerWindow twoServer, Player player, string[] cardArgs)
 {
     twoServer.DownDeck.Push(this);
     twoServer.PlayerList.RemovePlayerCard(player, this);
     twoServer.SendPlayerCards(player);
     twoServer.SendToAllPlayers("TOPCARD " + SortValue);
     twoServer.WaitForPlayerTarget("Target a player to drink!");
     twoServer.WaitingCard = this;
     return true;
 }
Ejemplo n.º 8
0
 public override Boolean Execute(TwoServerWindow twoServer, Player player, string[] cardArgs)
 {
     twoServer.DownDeck.Push(this);
     twoServer.PlayerList.RemovePlayerCard(player, this);
     twoServer.SendPlayerCards(player);
     twoServer.SendToAllPlayers("TOPCARD " + SortValue);
     twoServer.SendToPlayer(player, "TARGETPLAYER Princess Fufu!");
     twoServer.WaitingCard = this;
     twoServer.WaitForPlayerTarget("Who To Fufu?");
     return true;
 }
Ejemplo n.º 9
0
 public override Boolean Execute(TwoServerWindow twoServer, Player player, string[] cardArgs)
 {
     twoServer.DownDeck.Push(this);
     twoServer.PlayerList.RemovePlayerCard(player, this);
     twoServer.SendPlayerCards(player);
     twoServer.SendPlayerDrinks(twoServer.PlayerList.GetNextPlayer(1),1);
     twoServer.PlayerList.NextPlayer(2);
     twoServer.SendToAllPlayers("TOPCARD " + SortValue);
     return true;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Constructor requires a link back to the twoserver that initialized it
 /// </summary>
 /// <param name="twoServ"></param>
 public PlayerList( TwoServerWindow twoServ)
 {
     _twoServer = twoServ;
 }
Ejemplo n.º 11
0
 public override void OnDraw(TwoServerWindow twoServer, Player player, string[] cardArgs)
 {
     if (IsActive)
     {
         twoServer.PlayerPickupCard(CurrentDrawAmount, player);
         IsActive = false;
     }
     else
     {
         twoServer.PlayerPickupCard(1, player);
     }
     twoServer.SendToAllPlayers("TOPCARD " + SortValue + "1");
     twoServer.PlayerList.NextPlayer(1);
 }
Ejemplo n.º 12
0
 public void BroadcastServerThreadTest()
 {
     TwoServerWindow target = new TwoServerWindow(); // TODO: Initialize to an appropriate value
     target.BroadcastServerThread();
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Ejemplo n.º 13
0
 public void CardListTest()
 {
     TwoServerWindow target = new TwoServerWindow(); // TODO: Initialize to an appropriate value
     List<Card> expected = null; // TODO: Initialize to an appropriate value
     List<Card> actual;
     actual = target.CardList();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Ejemplo n.º 14
0
 public void WaitForPlayerTargetTest()
 {
     TwoServerWindow target = new TwoServerWindow(); // TODO: Initialize to an appropriate value
     string s = string.Empty; // TODO: Initialize to an appropriate value
     target.WaitForPlayerTarget(s);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Ejemplo n.º 15
0
 public void WaitForMooseTest()
 {
     TwoServerWindow target = new TwoServerWindow(); // TODO: Initialize to an appropriate value
     target.WaitForMoose();
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Ejemplo n.º 16
0
 public void SendPlayerDrinksTest()
 {
     TwoServerWindow target = new TwoServerWindow(); // TODO: Initialize to an appropriate value
     Player p = null; // TODO: Initialize to an appropriate value
     int noOfDrinks = 0; // TODO: Initialize to an appropriate value
     target.SendPlayerDrinks(p, noOfDrinks);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Ejemplo n.º 17
0
 public override Boolean Execute( TwoServerWindow twoServer, Player player, string[] cardArgs)
 {
     base.Execute(twoServer, player, cardArgs);
     twoServer.GameState = 4;
     twoServer.SendToAllPlayers("MOOSE");
     return true;
 }
Ejemplo n.º 18
0
 public StatusTick(TwoServerWindow twoServer, float timeToEvent)
     : base(twoServer, timeToEvent)
 {
     TwoServer = twoServer;
     TimeToEvent = timeToEvent;
 }
Ejemplo n.º 19
0
 public override Boolean Execute(TwoServerWindow twoServer, Player player, string[] cardArgs)
 {
     IsActive = true;
     CurrentDrawAmount = DrawAmount;
     if (twoServer.DownDeck.Peek().Types.Contains("DRAW " + CurrentDrawAmount) )
     {
         ColorDraw temp = (ColorDraw)twoServer.DownDeck.Peek();
         if (temp.IsActive)
             CurrentDrawAmount = temp.CurrentDrawAmount + DrawAmount;
     }
     if( twoServer.DownDeck.Peek().Types.Contains("TARGET " + CurrentDrawAmount))
     {
         PlayerTargetedCard temp = (PlayerTargetedCard)twoServer.DownDeck.Peek();
         if (temp.IsActive)
             CurrentDrawAmount = temp.CurrentDrawAmount + DrawAmount;
     }
     twoServer.DownDeck.Push(this);
     twoServer.PlayerList.RemovePlayerCard(player, this);
     twoServer.SendPlayerCards(player);
     twoServer.SendToAllPlayers("TOPCARD " + SortValue);
     twoServer.WaitForPlayerTarget(String.Format("Draw {0}",CurrentDrawAmount.ToString()));
     twoServer.WaitingCard = this;
     return true;
 }
Ejemplo n.º 20
0
 public TimedEvent(TwoServerWindow twoServer, float timeToEvent )
 {
     TwoServer = twoServer;
     TimeToEvent = timeToEvent;
 }
Ejemplo n.º 21
0
 public override void TargetedAction(TwoServerWindow twoServer, string[] args)
 {
     twoServer.PlayerList.SetPlayer(int.Parse(args[1]));
     twoServer.GameState = 1;
     return;
 }
Ejemplo n.º 22
0
 /// <summary>
 /// When the next player
 /// </summary>
 /// <param name="twoServer"></param>
 /// <param name="player">Player that picked up card</param>
 /// <param name="cardArgs">Additional arguments for the card</param>
 public virtual void OnDraw(TwoServerWindow twoServer, Player player, string[] cardArgs)
 {
     twoServer.SendToAllPlayers(String.Format("ANNOUNCE {0} picked up a card!",player.Name));
     twoServer.PlayerPickupCard(1,player);
     twoServer.PlayerList.NextPlayer(1);
 }
Ejemplo n.º 23
0
 public override void TargetedAction(TwoServerWindow twoServer, string[] args)
 {
     twoServer.SendAnnounce(twoServer.PlayerList.PlayerArray[int.Parse(args[1])].Name + " just became Princess FuFu!");
     twoServer.PlayerList.SetFufu(int.Parse(args[1]));
     twoServer.PlayerList.NextPlayer(1);
     twoServer.GameState = 1;
     return;
 }
Ejemplo n.º 24
0
 public virtual void TargetedAction(TwoServerWindow twoServer,string[] args)
 {
     return;
 }
Ejemplo n.º 25
0
 public override void OnDraw(TwoServerWindow twoServer, Player player, string[] cardArgs)
 {
     player.CardsInHand.Add(twoServer.DrawDeck.Pop());
     twoServer.SendPlayerCards(player);
     twoServer.PlayerList.NextPlayer(1);
 }
Ejemplo n.º 26
0
 public void SendDrinkFormTest1()
 {
     TwoServerWindow target = new TwoServerWindow(); // TODO: Initialize to an appropriate value
     Player p = null; // TODO: Initialize to an appropriate value
     float drinkTime = 0F; // TODO: Initialize to an appropriate value
     string message = string.Empty; // TODO: Initialize to an appropriate value
     target.SendDrinkForm(p, drinkTime, message);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Ejemplo n.º 27
0
        public override void TargetedAction(TwoServerWindow twoServer, string[] args)
        {
            twoServer.GameState = 1;
            twoServer.SendDrinkForm(twoServer.PlayerList.PlayerArray[int.Parse(args[1])], 4, "Two drinks for you!");

            twoServer.PlayerList.NextPlayer(1);
        }
Ejemplo n.º 28
0
        public override Boolean Execute(TwoServerWindow twoServer, Player player, string[] cardArgs)
        {
            IsActive = true;
            CurrentDrawAmount = DrawAmount;
            if (twoServer.DownDeck.Peek().Types.Contains("DRAW " + CurrentDrawAmount))
            {
                ColorDraw temp = (ColorDraw)twoServer.DownDeck.Peek();
                if( temp.IsActive )
                    CurrentDrawAmount = temp.CurrentDrawAmount + DrawAmount;
            }

            twoServer.DownDeck.Push(this);
            twoServer.PlayerList.RemovePlayerCard(player, this);
            twoServer.SendPlayerCards(player);
            twoServer.PlayerList.NextPlayer(1);
            twoServer.SendToAllPlayers("TOPCARD " + SortValue);
            return true;
        }
Ejemplo n.º 29
0
 public void RandomTauntTest()
 {
     TwoServerWindow target = new TwoServerWindow(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     actual = target.RandomTaunt();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Ejemplo n.º 30
0
 public void SendToPlayerTest()
 {
     TwoServerWindow target = new TwoServerWindow(); // TODO: Initialize to an appropriate value
     Player p = null; // TODO: Initialize to an appropriate value
     string toSend = string.Empty; // TODO: Initialize to an appropriate value
     target.SendToPlayer(p, toSend);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }