Esempio n. 1
0
 public static void UpdateStoneWallTile(StoneWall wall)
 {
     //if ((WorldMap.Instance.GetMapElement(cube.Position.X + 1, cube.Position.Y + 0, 7) != null &&
     //    (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y + 1, 7) == null) &&
     //    (WorldMap.Instance.GetMapElement(cube.Position.X + 0, cube.Position.Y - 1, 7) != null &&
     //    (WorldMap.Instance.GetMapElement(cube.Position.X - 1, cube.Position.Y + 0, 7) != null))))
     //    cube.TileType = TileType.DirtBottom;
 }
Esempio n. 2
0
        private void ExecuteMarking()
        {
            foreach (Vector3Int cube in _markedCubes)
            {
                if (_cursorMode == CursorMode.Mine)
                    WorldMap.Instance.GetMapElement(cube.X, cube.Y, cube.Z).Mark(MapElementState.MiningScheduled);
                if (_cursorMode == CursorMode.CropArea && _invalidCubes.Count == 0 && _dimMarking.X >= _minimumCropSize && _dimMarking.Y >= _minimumCropSize)
                {
                    // Marks the ground a certain color
                    if (_cropType == CropsType.Wheat)
                        WorldMap.Instance.GetMapElement(cube.X, cube.Y, cube.Z).Mark(MapElementState.WheatFieldScheduled);
                    if (_cropType == CropsType.Cannabis)
                        WorldMap.Instance.GetMapElement(cube.X, cube.Y, cube.Z).Mark(MapElementState.CannabisFieldScheduled);
                }
            }

            if (_cursorMode == CursorMode.Wall && _invalidCubes.Count == 0)
            {
                foreach (Vector3Int cube in _markedCubes)
                {
                    Building b = new StoneWall(new Vector3Int(cube.X, cube.Y, cube.Z - 1), 0);
                    WorldMap.Instance.AddBuilding(b);

                }
            }

            if (_cursorMode == CursorMode.CropArea && _invalidCubes.Count == 0 && _dimMarking.X >= _minimumCropSize && _dimMarking.Y >= _minimumCropSize)
            {
                PlaceField();
            }
            if (_cursorMode == CursorMode.IndoorCropArea && _invalidCubes.Count == 0 && _dimMarking.X >= _minimumCropSize && _dimMarking.Y >= _minimumCropSize)
            {
                PlaceIndoorField();
            }
            if (_cursorMode == CursorMode.Pasture && _invalidCubes.Count == 0 && _dimMarking.X >= _minimumPastureSize && _dimMarking.Y >= _minimumPastureSize)
            {
                PlacePasture();
            }
            StopMarking();
        }