Example #1
0
 public override void TakeAction( Player player, out object data )
 {
     player.Resources[AllResources.Reed] += this.Resources[AllResources.Reed];
     player.Resources[AllResources.Stone] += this.Resources[AllResources.Stone];
     player.Resources[AllResources.Food] += this.Resources[AllResources.Food];
     data = null;
 }
Example #2
0
        private void newGameToolStripMenuItem_Click( object sender, EventArgs e )
        {
            GameSetupForm setup = new GameSetupForm();
            DialogResult result = setup.ShowDialog();
            if( result == DialogResult.OK )
            {
                gm = new GameManager();

                // get all the players from the dialog
                int numPlayers = Properties.Settings.Default.NumPlayers;

                if( numPlayers >= 1 )
                {
                    Player p = new Player( setup.player1NameBox.Text );
                    gm.Players.Add( p );
                }
                if( numPlayers >= 2 )
                {
                    Player p = new Player( setup.player2NameBox.Text );
                    gm.Players.Add( p );
                }
                if( numPlayers >= 3 )
                {
                    Player p = new Player( setup.player3NameBox.Text );
                    gm.Players.Add( p );
                }
                if( numPlayers >= 4 )
                {
                    Player p = new Player( setup.player4NameBox.Text );
                    gm.Players.Add( p );
                }
                if( numPlayers >= 5 )
                {
                    Player p = new Player( setup.player5NameBox.Text );
                    gm.Players.Add( p );
                }

                gm.StartGame();
            }
        }
Example #3
0
 public override void TakeAction( Player player, out object data )
 {
     player.Resources[AllResources.Sheep] += this.Resources[AllResources.Sheep];
     this.Resources[AllResources.Sheep] = 0;
     data = null;
 }
Example #4
0
 public override void TakeAction( Player player, out object data )
 {
     throw new NotImplementedException();
 }
Example #5
0
 private void TakeActionRegular( Player player, out object data )
 {
     throw new NotImplementedException();
 }
Example #6
0
 public override void TakeAction( Player player, out object data )
 {
     this.ActionDelegate( player, out data );
 }
Example #7
0
 public override void TakeAction( Player player, out object data )
 {
     player.Resources[AllResources.Vegetable]++;
     data = null;
 }
Example #8
0
 private void TakeActionRegular( Player player, out object data )
 {
     player.Resources[AllResources.Food] += 2;
     data = null;
 }
Example #9
0
 private void TakeActionFamily( Player player, out object data )
 {
     player.Resources[AllResources.Food]++;
     //todo Add logic to allow player to choose a resource
     throw new NotImplementedException();
 }
Example #10
0
 /// <summary>
 /// What happens when a player chooses this Action.
 /// </summary>
 /// <param name="player">The player who took the Action.</param>
 /// <param name="data">An optional parameter that Actions can use to pass back data to the caller. Not all Actions will use this data.</param>
 public abstract void TakeAction( Player player, out object data );
Example #11
0
 public FamilyMember( Player owner )
 {
     this.Owner = owner;
 }