コード例 #1
0
        public static bool IsActivePlayer(Player P, GameState State)
        {
            bool output = false;

            if (State.ReturnPlayerByBasePlayer(P).OrderNumber == State.ActiveGamePlayer)
            {
                output = true;
            }
            return(output);
        }
コード例 #2
0
        public static void ToggleMorguage(Player P, GameState State, int ID)
        {
            GamePlayer    local = State.ReturnPlayerByBasePlayer(P);
            OwnedProperty mProp = (from h in local.PlayerProperty
                                   where h.ID == ID
                                   select h).FirstOrDefault();

            if (mProp.Morguage)
            {
                Morguage(local, ID, true);
            }
            else
            {
                Morguage(local, ID);
            }
        }
コード例 #3
0
        public static void TradeAccepted(GameState State)
        {
            GamePlayer requester = State.ReturnPlayerByOrder(State.ActiveGamePlayer);
            GamePlayer accepter  = State.ReturnPlayerByBasePlayer(State.PlayerTradeRequested);

            if (State.PropertyTradeDirection == Direction.indir)
            {
                PropertyOwnershipChange(State.PropertyTradeRequested, State, requester, accepter);
            }
            else
            {
                PropertyOwnershipChange(State.PropertyTradeRequested, State, accepter, requester);
            }
            State.PlayerTradeRequested   = null;
            State.PropertyTradeRequested = 0;
            State.PropertyTradeDirection = Direction.nulled;
            State.CurrentPhase           = TurnState.WaitPhase;
        }
コード例 #4
0
        public static void ToggleMorguage(Player P, GameState State, int ID)
        {
            GamePlayer    local = State.ReturnPlayerByBasePlayer(P);
            OwnedProperty mProp = (from h in local.PlayerProperty
                                   where h.ID == ID
                                   select h).FirstOrDefault();

            if (mProp.Morguage)
            {
                Morguage(local, ID, true);
                State.EventNotification = P.PlayerName + " zet " + State.LocalCardData[ID].Name + " in hypoteek";
            }
            else
            {
                Morguage(local, ID);
                State.EventNotification = P.PlayerName + " betaalt de hypoteek op " + State.LocalCardData[ID].Name;
            }
        }
コード例 #5
0
        public static void TradeAccepted(GameState State)
        {
            GamePlayer requester = State.ReturnPlayerByOrder(State.ActiveGamePlayer);
            GamePlayer accepter  = State.ReturnPlayerByBasePlayer(State.PlayerTradeRequested);

            if (State.PropertyTradeDirection == Direction.indir)
            {
                PropertyOwnershipChange(State.PropertyTradeRequested, State, requester, accepter);
                requester.Cash -= State.PropertyTradeValue;
                accepter.Cash  += State.PropertyTradeValue;
            }
            else
            {
                PropertyOwnershipChange(State.PropertyTradeRequested, State, accepter, requester);
                accepter.Cash  -= State.PropertyTradeValue;
                requester.Cash += State.PropertyTradeValue;
            }
            State.EventNotification      = requester.MyPlayer.PlayerName + " verhandelt " + State.LocalCardData[State.PropertyTradeRequested].Name + " met " + accepter.MyPlayer.PlayerName;
            State.PlayerTradeRequested   = null;
            State.PropertyTradeRequested = 0;
            State.PropertyTradeDirection = Direction.nulled;
            State.CurrentPhase           = TurnState.WaitPhase;
            State.PropertyTradeValue     = 0;
        }
コード例 #6
0
 public static void TradeRejected(GameState State)
 {
     State.PlayerTradeRequested   = null;
     State.PropertyTradeRequested = 0;
     State.PropertyTradeDirection = Direction.nulled;
     State.CurrentPhase           = TurnState.WaitPhase;
     State.PropertyTradeValue     = 0;
     State.EventNotification      = State.ReturnPlayerByOrder(State.ActiveGamePlayer).MyPlayer.PlayerName + " weigert te handelen met " + State.ReturnPlayerByBasePlayer(State.PlayerTradeRequested).MyPlayer.PlayerName;
 }