public void MoveToPasture(PastureSim pasture) { _pasture = pasture; _currentTask = new MoveToPositionTask(pasture.GetRandomFreeSpace()); _currentBehavior = null; _inPasture = true; }
public CollectFoodFromPastureTask(PastureSim pasture, WorldObject foodItem) { pasture.Building.TasksAssociatedWithBuilding.Add(this); Pasture = pasture; FoodItem = foodItem; TaskType = TaskType.CollectFoodFromPasture; }
public PastureBuilding(Vector3Int position, int constructionPoints, PastureSim pastureSim) : base(position, constructionPoints, BuildingType.PastureBuilding) { SetDimentions(new Vector3Int(1, 1, 1)); _pastureSim = pastureSim; NeededConstructionPoints = 100; NeededForConstruction = new Dictionary<MapElementType, int>(); NeededForConstruction.Add(MapElementType.Lumber, 2); NeededForConstruction.Add(MapElementType.Stone, 2); _texture = WorldMap.Instance.GetContent().Load<Texture2D>("transparent"); }
public PastureWindow(PastureSim pasture, Vector2 position) : base("Animal Pasture", true) { List<string> options = new List<string>(); _pasture = pasture; options.Add("Pig"); options.Add("Cattle"); options.Add("Sheep"); Position = position; Dimention = new Vector2(400, 200); _animalSelection = new DropDown(new Vector2(195, 30), options, "None"); AddGuiComponent(_animalSelection); AddGuiComponent(new Label("Animal:", new Vector2(20, 37))); //Components.Add(new SquareDropdown(new Vector2(10, 30), options, "None")); }
public void AddPastureSim(PastureSim pasture) { _pastureSims.Add(pasture); }
public void SelectPasture(PastureSim pasture) { _selectedPasture = pasture; _selectionParts.Clear(); _selectionParts.Add(new SelectionPart() { Point = new Point(pasture.CornerFence.X, pasture.CornerFence.Y), Type = SelectionPartType.TopLeft }); _selectionParts.Add(new SelectionPart() { Point = new Point(pasture.CornerFence.X + pasture.Dim.X - 1, pasture.CornerFence.Y), Type = SelectionPartType.TopRight }); _selectionParts.Add(new SelectionPart() { Point = new Point(pasture.CornerFence.X, pasture.CornerFence.Y + pasture.Dim.Y - 1), Type = SelectionPartType.BottomLeft }); _selectionParts.Add(new SelectionPart() { Point = new Point(pasture.CornerFence.X + pasture.Dim.X - 1, pasture.CornerFence.Y + pasture.Dim.Y - 1), Type = SelectionPartType.BottomRight }); if (pasture.IsConstructed == true) GuiSystem.AddGuiComponent(new PastureWindow(pasture, new Vector2(MouseInput.X, MouseInput.Y - 300))); else GuiSystem.AddGuiComponent(new UnderConstruction(new Vector2(MouseInput.X, MouseInput.Y - 300))); }
public void SetActionPasture(PastureSim sim) { _pastureSim = sim; }
private void PlacePasture() { _crops = new List<GameMono.CropBase>(); _fences = new List<WorldObjects.Fence>(); PlaceFences(); var pastureSim = new PastureSim(_fences); PastureBuilding b = new PastureBuilding(_clickedMapElement, 0, pastureSim); pastureSim.Building = b; WorldMap.Instance.AddBuilding(b); SimulationWorld.Instance.AddPastureSim(pastureSim); }
public WorkAtPastureTask(PastureSim sim) { sim.Building.TasksAssociatedWithBuilding.Add(this); PastureSim = sim; TaskType = Tasks.TaskType.WorkAtPasture; }
public void PutInPasture(PastureSim pasture) { Pasture = pasture; ((AnimalAi)_ai).MoveToPasture(pasture); }