Aurora.Modules.CityBuilder.CityModule.doRoad C# (CSharp) 메소드

doRoad() 개인적인 메소드

private doRoad ( int x1, int y1, int width, int depth ) : void
x1 int
y1 int
width int
depth int
리턴 void
        private void doRoad(int x1, int y1, int width, int depth)
        {
            int lanes;
            int divider;
            int sidewalk;
            if (width > depth)
                lanes = depth;
            else
                lanes = width;
            if (lanes < 4)
                return;
            bool odd = false;
            int i = (lanes % 2);
            if (i > 0) odd = true;
            if (odd)//lanes % 2)
            {
                lanes--;
                divider = 1;
            }
            else
                divider = 0;
            sidewalk = 2;// MAX(2, (lanes - 10));
            lanes -= sidewalk;
            sidewalk /= 2;
            lanes /= 2;
            cityMap.ClaimPlot(cityMap.MakePlot(x1, y1, width, depth, PlotClaimType.CLAIM_NONE));
            if (width > depth)
            {
                cityMap.ClaimPlot(cityMap.MakePlot(x1, y1 + sidewalk, width, lanes, PlotClaimType.CLAIM_TRANSPORT));
                cityMap.ClaimPlot(cityMap.MakePlot(x1, y1 + sidewalk + lanes + divider, width, lanes, PlotClaimType.CLAIM_TRANSPORT));
            }
            else
            {
                cityMap.ClaimPlot(cityMap.MakePlot(x1 + sidewalk, y1, lanes, depth, PlotClaimType.CLAIM_TRANSPORT));
                cityMap.ClaimPlot(cityMap.MakePlot(x1 + sidewalk + lanes + divider, y1, lanes, depth, PlotClaimType.CLAIM_TRANSPORT));
            }
        }