Exemple #1
0
    public RegFile(Building build, Rect dimOnMap, Ca category, Vector3 iniPosition,
                   Inventory InventoryP,
                   List <string> peopleDict,
                   List <VectorLand> LandZone1,
                   Rect dimOnMapHor               = new Rect(),
                   List <Vector3> tilePosVert     = null, List <Vector3> tilePosHor      = null, List <Vector3> planesOnAirPos = null,
                   Vector3 tileScale              = new Vector3(), List <int> partsOnAir = null,
                   H dominantSide                 = H.None, H startingStage = H.None, int rotationFacerIndex       = -1, string materialKey = "",
                   List <Vector3> planesOnSoilPos = null, List <int> partsOnSoil = null, Vector3 min               = new Vector3(),
                   Vector3 max                     = new Vector3(), H instructionP = H.None, BookedHome bookedHome = null,
                   Dispatch dispatch               = null, Family[] familes        = null,
                   int dollarsPay                  = 0,
                   List <Vector3> anchors          = null, Dock dock = null, string root = "",
                   BuildersManager buildersManager = null
                   )
    {
        MyId         = build.MyId;
        HType        = build.HType;
        _dimOnMap    = dimOnMap;
        Category     = category;
        _iniPos      = iniPosition;
        _dimOnMapHor = dimOnMapHor;
        _tilePosVert = tilePosVert;
        _tilePosHor  = tilePosHor;
        _tileScale   = tileScale;
        //bridge stuff
        _partsOnAir    = partsOnAir;
        _dominantSide  = dominantSide;
        _planeOnAirPos = planesOnAirPos;
        _planesOnSoil  = planesOnSoilPos;
        _partsOnSoil   = partsOnSoil;

        _startingStage      = startingStage;
        _rotationFacerIndex = rotationFacerIndex;
        _materialKey        = materialKey;
        _min        = min;
        _max        = max;
        Instruction = instructionP;

        Inventory      = InventoryP;
        PeopleDict     = peopleDict;
        this.LandZone1 = LandZone1;
        BookedHome1    = bookedHome;

        Dispatch1  = dispatch;
        Familes    = familes;
        DollarsPay = dollarsPay;
        Anchors    = anchors.ToArray();
        Dock1      = dock;

        Root = root;

        ProductionReport = build.ProductionReport;
        MaxPeople        = build.MaxPeople;
        Decoration       = build.Decoration1;
        Name             = build.NameBuilding();

        BuildersManager = buildersManager;
    }
Exemple #2
0
    /// <summary>
    /// Will add a poly with the seq NW, NE, SE, SW to the _allBuilding List. then will call UpdateCurrentVertexRect()
    /// Adds the file to Registro All that is the save list to file of buildings
    /// </summary>
    public void AddBuildToAll(Building build, List <Vector3> poly, Ca categ, Vector3 iniPosition,
                              Inventory inventory,
                              List <string> PeopleDict,
                              List <VectorLand> LandZone1,
                              List <Vector3> polyHoriz       = null,
                              List <Vector3> tilePosVert     = null, List <Vector3> tilePosHor = null, List <Vector3> planesOnAirPos = null,
                              Vector3 tileScale              = new Vector3(), List <int> parts = null,
                              H dominantSide                 = H.None, H startingStage = H.None, int rotationFacerIndex = -1, string materialKey = "",
                              List <Vector3> planesOnSoilPos = null, List <int> partsOnSoil = null, Vector3 min         = new Vector3(),
                              Vector3 max            = new Vector3(), H instructionP = H.None, BookedHome BookedHome1   = null,
                              Dispatch dispatch      = null, Family[] Families       = null,
                              int dollarsPay         = 0,
                              List <Vector3> anchors = null, Dock dock = null, string root = ""
                              )
    {
        // 12 hours to find this OMG!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        // I was creating the recatblgele and not inverting Y.. then I invert Y but didint inverted in
        //IsColliding() chet !!!! And i knew it bz i inverted the big rectangle...
        //with the rectangles inverted works like a charm... we have to do it bz im using North as bigger
        //and south as less... in the Rect cordinates is the other way around

        //this is the usual poly will be filled for eg regular structures only use this one.
        //For ways is the vertic bound
        var to = ReturnDimOnMap(poly);

        Rect toHoriz = new Rect();

        if (polyHoriz != null)
        {
            toHoriz = U2D.FromPolyToRect(polyHoriz);
            toHoriz = U2D.ReturnRectYInverted(toHoriz);
        }

        //ading to All
        RegFile regFile = new RegFile(build, to, categ, iniPosition,
                                      inventory,
                                      PeopleDict, LandZone1,
                                      toHoriz, tilePosVert: tilePosVert, tilePosHor: tilePosHor,
                                      planesOnAirPos: planesOnAirPos, tileScale: tileScale, partsOnAir: parts, dominantSide: dominantSide, startingStage: startingStage, rotationFacerIndex: rotationFacerIndex,
                                      materialKey: materialKey, planesOnSoilPos: planesOnSoilPos, partsOnSoil: partsOnSoil, min: min, max: max,
                                      instructionP: instructionP, bookedHome: BookedHome1, dispatch: dispatch, familes: Families,
                                      dollarsPay: dollarsPay,
                                      anchors: anchors, dock: dock, root: root);

        //UVisHelp.CreateHelpers(anchors, Root.blueCube);
        AddToAll(regFile);
        AddToBuilderManager(build.MyId);

        AddSpecToList(categ);
        if (_locHoverVert.Count > 0)
        {
            UpdateCurrentVertexRect(_locHoverVert);
        }
        //use on the drawing debug functionalitie only:
        //toDraw.Add(to);
        //toDraw.Add(toHoriz);
    }