Example #1
0
        private void setup()
        {
            _revisionnumber = 0;

            for (int i = 0; i < IsBought.Length; i++)
            {
                IsBought[i] = false;
            }
            for (int i = 0; i < Ownership.Length; i++)
            {
                Ownership[i] = null;
            }
            ActivePlayer     = ReturnPlayerByOrder(0).MyPlayer;
            ActiveGamePlayer = 0;
            GameFunctions.randomStarterDie(this);
            PropertyTradeRequested = 0;
            PlayerTradeRequested   = null;
            PropertyTradeDirection = GameFunctions.Direction.nulled;
            ActiveTileName         = "Start";
            ChanceChoice           = false;
            _setupComplete         = true;
        }
        //need ID of the property the player wants to build a house on, call results in no action if property is morguage, player doesn't have a full set or house level is already at 5
        public void BuyHouse(Player P, byte PropertyID)
        {
            GamePlayer gplayer = publicState.ReturnPlayerByBasePlayer(P);

            GameFunctions.BuyHouse(gplayer, PropertyID);
        }
 //Requested Player Rejects trade (opposite of AcceptTrade())
 public void RejectTrade()
 {
     GameFunctions.TradeRejected(this.publicState);
 }
 //Requested Player Accepts Trade (needs clientside check for Publicstate.PlayerTradeRequested)
 public void AcceptTrade()
 {
     GameFunctions.TradeAccepted(this.publicState);
 }
 //Tradepartner = other player :: PropertyId is 0 - 27 byte value in housecarddatabase :: Dir = direction of trade True= In False=Out :: Amount is how much is requested
 public void RequestTrade(Player TradePartner, byte PropertyID, bool Dir, int Amount)
 {
     GameFunctions.TradeRequested(this.publicState, TradePartner, PropertyID, Dir, Amount);
 }
 //to be called when player ends turn
 public void Turnchange()
 {
     GameFunctions.ChangeActivePlayer(this.publicState);
 }
 //1st call enables morguage, second call pays it back bind to same button or different
 public void MorguageToggle(Player P, int ID)
 {
     GameFunctions.ToggleMorguage(P, this.publicState, ID);
 }
 //Attempts to buy the tile the active player is occupying, call results in no action if GameState.Enablebuy == false
 public void BuyActiveTile()
 {
     GameFunctions.BuyPropertyFromBank(this.publicState);
 }
 //Small check to test if the calling player is active
 public bool ActiveTest(Player testPlayer)
 {
     return(GameFunctions.IsActivePlayer(testPlayer, this.publicState));
 }
 //Call handles dice throw and immediate unavoidable effects (paying rent, taking cards, jail) Manual Purchase required
 public void Dice()
 {
     GameFunctions.castPlayerDie(publicState.ReturnPlayerByOrder(publicState.ActiveGamePlayer), this);
 }
 //Player leaves the game
 public void Quit(Player P)
 {
     GameFunctions.LeaveGame(publicState.ReturnPlayerByBasePlayer(P));
 }
 //Player draws a communal card with the choice between payment and picking a chance card: True equals chance chosen only if GameState.ChanceChoice is true
 public void ChanceCardChoice(bool choice, Player P)
 {
     GameFunctions.CardChoiceChance(choice, publicState.ReturnPlayerByBasePlayer(P));
 }
 //Player escapes prison manually, needs button prompt. Bool equals false if player has escape from jail card
 public void EscapePrison(Player P, bool payed = true)
 {
     GameFunctions.PrisonRelease(publicState.ReturnPlayerByBasePlayer(P), payed);
 }