public void ShowFarmerDock(Farmer context, GamePlayer player)
 {
     if (_currentDock != null) _currentDock.Hide();
     _farmerDock.UpdateContext(context, player);
     _currentDock = _farmerDock;
     _currentDock.Show();
 }
 void createFarmerBtn_Click(object sender, System.EventArgs e)
 {
     Vector2 loc = Context.NextBuiltUnitLocation;
     Farmer farmer = new Farmer(Context.GameWorldRef, Context.PlayerRef, loc);
     farmer.CurrentAnimation = Context.NextIdleAnimation;
     Context.PlayerRef.People.Add(farmer);
 }
        public GamePlayer(GameWorld gameWorldRef)
        {
            _gameWorldRef = gameWorldRef;

            People = new List<CreatureBase>();
            Buildings = new List<BuildingBase>();

            BuildingBase building3 = new ResidentialHouse(gameWorldRef, this, new Point(15, 20));
            BuildingBase building6 = new ResidentialHouse(gameWorldRef, this, new Point(6, 20));
            BuildingBase building4 = new TrainingCamp(gameWorldRef, this, new Point(10, 16));
            BuildingBase building1 = new TrainingCamp(gameWorldRef, this, new Point(30, 30));
            BuildingBase building5 = new Stable(gameWorldRef, this, new Point(14, 35));

            Buildings.Add(building6); Buildings.Add(building4);
            Buildings.Add(building5); Buildings.Add(building1);
            Buildings.Add(building3);

            Farms = new List<Farm>();
            Farms.Add(new Farm("farm1", gameWorldRef, this, new Point(4, 28)));
            Farms.Add(new Farm("farm1", gameWorldRef, this, new Point(6, 32)));
            Farms.Add(new Farm("farm1", gameWorldRef, this, new Point(10, 32)));
            Farms.Add(new Farm("farm1", gameWorldRef, this, new Point(12, 28)));

            //TODO: create player presets instead of following
            CreatureBase human1 =
                new Swordsman(gameWorldRef, this, new Vector2(300, 400));
            CreatureBase human2 =
                new Horseman(gameWorldRef, this, new Vector2(350, 400));
            CreatureBase human3 =
                  new Farmer(gameWorldRef, this, new Vector2(300, 460));
            CreatureBase human4 =
                  new Knight(gameWorldRef, this, new Vector2(350, 460));

            People.Add(human1); People.Add(human4); People.Add(human3); People.Add(human2);
        }
 public CarryToHouseAction(Farmer farmer, GamePlayer player)
 {
     _farmer = farmer;
     _player = player;
     foreach (var building in player.Buildings)
     {
         if (building is ResidentialHouse)
         {
             _storageHouse = building as ResidentialHouse;
             break;
         }
     }
 }
 public ReturnFromBuildingToFarmAction(Farmer farmer, GamePlayer player)
 {
     _farmer = farmer;
     _player = player;
 }
 public GoToFarmAction(Farmer farmer, GamePlayer player)
 {
     _farmer = farmer;
     _player = player;
 }
 /// <summary>
 /// updates the data source and command operator
 /// </summary>
 /// <param name="context"></param>
 /// <param name="player"></param>
 public virtual void UpdateContext(Farmer context, GamePlayer player)
 {
     Context = context;
     Player = player;
     UpdateDisplayText();
 }
 public SeedAction(Farmer farmer, GamePlayer player)
 {
     _farmer = farmer;
     _player = player;
 }
 public GatherAction(Farmer farmer, GamePlayer player)
 {
     _farmer = farmer;
     _player = player;
 }