private void _OnBuildStairsButtonCheckedChanged(Object Sender, EventArgs EventArguments) { _EntityPrototype = null; if (_BuildStairsButton.Checked == true) { _EntityPrototype = new EntityPrototype(); _EntityPrototype.BackgroundColor = Data.StairsBackgroundColor; _EntityPrototype.BorderColor = Data.StairsBorderColor; _EntityPrototype.SetGameFunction(_Game.BuildStairs); _EntityPrototype.SetHeight(Data.StairsBlockHeight); _EntityPrototype.SetWidth(Data.StairsBlockWidth); } }
private void _OnHireWorkerButtonCheckedChanged(Object Sender, EventArgs EventArguments) { _EntityPrototype = null; if (_HireWorkerButton.Checked == true) { _EntityPrototype = new EntityPrototype(); _EntityPrototype.SnapToBlocksHorizontally = false; _EntityPrototype.BackgroundColor = Data.WorkerBackgroundColor; _EntityPrototype.BorderColor = Data.WorkerBorderColor; _EntityPrototype.SetGameFunction(_Game.HireWorker); _EntityPrototype.SetHeight(Data.PersonHeightMean); _EntityPrototype.SetWidth(Data.PersonWidthMean); } }
private void _OnPlaceCatButtonCheckedChanged(Object Sender, EventArgs EventArguments) { _EntityPrototype = null; if (_PlaceCatButton.Checked == true) { _EntityPrototype = new EntityPrototype(); _EntityPrototype.SnapToBlocksHorizontally = false; _EntityPrototype.BackgroundColor = Data.CatBackgroundColor; _EntityPrototype.BorderColor = Data.CatBorderColor; _EntityPrototype.DrawType = DrawType.Ellipse; _EntityPrototype.SetGameFunction(_Game.PlaceCat); _EntityPrototype.SetHeight(Data.CatHeight); _EntityPrototype.SetWidth(Data.CatWidth); } }
private void _OnNewGame() { _UncheckAllToolButtons(); // places the camera closely above ground with half a block of ground visible _CameraPosition = new Vector2(0.0, _Canvas.Height / Data.BlockHeight / 2.0 - 0.5); _CameraVelocity = new Vector2(0.0, 0.0); _FloatingTexts.Clear(); _Game.OnEarnMoney += delegate(UInt64 Cents, Vector2 Location) { var FloatingText = new FloatingText(); FloatingText.Color = Data.EarnMoneyFloatingTextColor; FloatingText.Offset = new Vector2(0.0, 0.0); FloatingText.Origin = Location; FloatingText.Text = _Game.GetMoneyString(Cents); FloatingText.Timeout = 1.2; _FloatingTexts.Add(FloatingText); }; _Game.OnSpendMoney += delegate(UInt64 Cents, Vector2 Location) { var FloatingText = new FloatingText(); FloatingText.Color = Data.SpendMoneyFloatingTextColor; FloatingText.Offset = new Vector2(0.0, 0.0); FloatingText.Origin = Location; FloatingText.Text = _Game.GetMoneyString(Cents); FloatingText.Timeout = 1.2; _FloatingTexts.Add(FloatingText); }; _EntityPrototype = null; _DragPoint = null; _LastTick = DateTime.MinValue; _MoveButton = null; _MovePerson = null; _Zoom = 1.0f; }