Exemplo n.º 1
0
 public Prince(IDealListener listener)
 {
     this.listener = listener;
     Name          = "Prince";
     Description   = "Choose any player to discard his or her hand and draw a new card";
     Value         = 5;
 }
 /// <summary>
 /// The Close.
 /// </summary>
 public void Close()
 {
     if (server != null)
     {
         WriteEcho("Server instance shutdown ");
         server.CloseListener();
         server = null;
     }
     else
     {
         WriteEcho("Server instance doesn't exist ");
     }
 }
        /// <summary>
        /// The Start.
        /// </summary>
        /// <param name="ServerIdentity">The ServerIdentity<see cref="MemberIdentity"/>.</param>
        /// <param name="security">The security<see cref="IMemberSecurity"/>.</param>
        /// <param name="OnEchoEvent">The OnEchoEvent<see cref="IDeputy"/>.</param>
        public void Start(MemberIdentity ServerIdentity, IMemberSecurity security = null, IDeputy OnEchoEvent = null)
        {
            server          = DealListener.Instance;
            server.Identity = ServerIdentity;
            Security        = security;

            new Thread(new ThreadStart(server.StartListening)).Start();

            server.HeaderSent      = new DealEvent("HeaderSent", this);
            server.MessageSent     = new DealEvent("MessageSent", this);
            server.HeaderReceived  = new DealEvent("HeaderReceived", this);
            server.MessageReceived = new DealEvent("MessageReceived", this);
            server.SendEcho        = OnEchoEvent;

            WriteEcho("Dealer instance started");
        }
Exemplo n.º 4
0
 public void NewDeck(IDealListener dealListener)
 {
     deck = new List <Card>()
     {
         new Princess(),
         new Countess(),
         new King(),
         new Prince(dealListener),
         new Prince(dealListener),
         new Handmaid(),
         new Handmaid(),
         new Baron(),
         new Baron(),
         new Priest(),
         new Priest(),
         new Guard(),
         new Guard(),
         new Guard(),
         new Guard(),
         new Guard()
     };
 }
Exemplo n.º 5
0
 public Deck(IDealListener dealListener)
 {
     NewDeck(dealListener);
 }