Example #1
0
        public FieldWindow(FieldSim field, Vector2 position)
            : base("Field", true)
        {
            List<string> options = new List<string>();

            if (field.GetType() == typeof(IndoorFieldSim))
            {
                foreach (CropsType type in GlobalResources.AvailableIndoorCrops)
                {
                    options.Add(type.ToString());
                }
            }
            else
            {
                foreach (CropsType type in GlobalResources.AvailableCrops)
                {
                    options.Add(type.ToString());
                }
            }

            Position = position;
            _field = field;

            Dimention = new Vector2(400, 200);

            _cropChooser = new DropDown(new Vector2(195, 30), options, "None");
            _lastSelected = _cropChooser.Selected;

            AddGuiComponent(_cropChooser);
            AddGuiComponent(new Label("Crop type:", new Vector2(20, 37)));
            //Components.Add(new SquareDropdown(new Vector2(10, 30), options, "None"));
        }
Example #2
0
        public FieldBuilding(Vector3Int position, int constructionPoints, FieldSim field)
            : base(position, constructionPoints, BuildingType.FieldBuilding)
        {
            SetDimentions(new Vector3Int(1, 1, 1));

            _field = field;

            NeededConstructionPoints = 100;

            NeededForConstruction = new Dictionary<MapElementType, int>();
            NeededForConstruction.Add(MapElementType.Lumber, 2);
            NeededForConstruction.Add(MapElementType.Stone, 2);

            _texture = WorldMap.Instance.GetContent().Load<Texture2D>("transparent");
        }
Example #3
0
 public void AddFieldSim(FieldSim field)
 {
     _fieldSims.Add(field);
 }
Example #4
0
 public PlantFieldTask(FieldSim fieldSim)
 {
     fieldSim.AssociatedBuilding.TasksAssociatedWithBuilding.Add(this);
     Field = fieldSim;
     TaskType = TaskType.PlantCrop;
 }
        public void SelectField(FieldSim field)
        {
            _selectedField = field;

            _selectionParts.Clear();

            _selectionParts.Add(new SelectionPart() { Point = new Point(field.Corner.X, field.Corner.Y), Type = SelectionPartType.TopLeft });
            _selectionParts.Add(new SelectionPart() { Point = new Point(field.Corner.X + field.Dim.X - 1, field.Corner.Y), Type = SelectionPartType.TopRight });
            _selectionParts.Add(new SelectionPart() { Point = new Point(field.Corner.X, field.Corner.Y + field.Dim.Y - 1), Type = SelectionPartType.BottomLeft });
            _selectionParts.Add(new SelectionPart() { Point = new Point(field.Corner.X + field.Dim.X - 1, field.Corner.Y + field.Dim.Y - 1), Type = SelectionPartType.BottomRight });

            if (field.IsFieldBuild() == true)
                GuiSystem.AddGuiComponent(new FieldWindow(_selectedField, new Vector2(MouseInput.X, MouseInput.Y - 300)));
            else
                GuiSystem.AddGuiComponent(new UnderConstruction(new Vector2(MouseInput.X, MouseInput.Y - 300)));
        }
Example #6
0
 public void SetActionField(FieldSim field)
 {
     _actionField = field;
 }
Example #7
0
        private void PlaceField()
        {
            _crops = new List<GameMono.CropBase>();
            _fences = new List<WorldObjects.Fence>();

            PlaceCrops();

            FieldSim fs = new FieldSim(_crops);
            Building b = new FieldBuilding(_clickedMapElement, 0, fs);
            fs.AssociatedBuilding = b;

            WorldMap.Instance.AddBuilding(b);

            SimulationWorld.Instance.AddFieldSim(fs);
        }