private void BuyWaterTurretModel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (currentStructure == null && game.PlayerCash >= WaterTurret.GetCost()) { currentStructure = PurchaseStructure(typeof(WaterTurret)); } }
private void Initialize() { buyWallModel = (Canvas)game.GameObjectModels["buyWallModel"]; buyWaterTurretModel = (Canvas)game.GameObjectModels["buyWaterTurretModel"]; regretPurchaseModel = (Canvas)game.GameObjectModels["regretPurchaseModel"]; var buyWallText = (TextBlock)GameHelper.FindCanvasChild(buyWallModel, "buyWallTextBlock"); var buyWTurretText = (TextBlock)GameHelper.FindCanvasChild(buyWaterTurretModel, "buyWaterTurretTextBlock"); buyWallText.Text = buyWallText.Text + Wall.GetCost().ToString(); buyWTurretText.Text = buyWTurretText.Text + WaterTurret.GetCost().ToString(); }
private void Form_KeyDown(object sender, KeyEventArgs e) { if (currentStructure == null && e.Key == Key.D && game.PlayerCash >= Wall.GetCost()) { currentStructure = PurchaseStructure(typeof(Wall)); } if (currentStructure == null && e.Key == Key.F && game.PlayerCash >= WaterTurret.GetCost()) { currentStructure = PurchaseStructure(typeof(WaterTurret)); } if (e.Key == Key.B) { RegretPurchase(); } if (e.Key == Key.Tab) { RotateWall(currentStructure as Wall); } }