Ejemplo n.º 1
0
        public bool DrawOpenPassengerCar(Protocol.PassengerCarColor color, Action <Protocol.TurnResp> callback = null)
        {
            if (IsActionBlocked(Protocol.TurnType.DrawPassengerCars, true))
            {
                return(false);
            }

            StringBuilder builder = new StringBuilder();

            builder.Append("DrawPassengerCars false ")
            .Append(color.ToString());

            this.OnReceivedActionResponse[(int)Protocol.TurnType.DrawPassengerCars] += callback;
            this.client.Send(builder.ToString());

            return(true);
        }
Ejemplo n.º 2
0
        public bool ClaimRoute(Protocol.Destination destA, Protocol.Destination destB, Protocol.PassengerCarColor routeColor, Protocol.PassengerCarColor passengerCarColor, Action <Protocol.TurnResp> callback = null)
        {
            if (IsActionBlocked(Protocol.TurnType.ClaimRoute, true))
            {
                return(false);
            }

            StringBuilder builder = new StringBuilder();

            builder.Append("ClaimRoute ")
            .Append(destA.ToString())
            .Append(" ")
            .Append(destB.ToString())
            .Append(" ")
            .Append(routeColor)
            .Append(" ")
            .Append(passengerCarColor);

            this.OnReceivedActionResponse[(int)Protocol.TurnType.ClaimRoute] += callback;

            this.client.Send(builder.ToString());

            return(true);
        }