Пример #1
0
    public void setRiverJunction()
    {
        if (upOrDownEdge == null || eastWardEdge == null || westWardEdge == null)
        {
        }
        else
        {
            BiomeTransistion uBT = upOrDownEdge.getBiomeTransistion();
            BiomeTransistion eBT = eastWardEdge.getBiomeTransistion();
            BiomeTransistion wBT = westWardEdge.getBiomeTransistion();

            bool uCheck = (uBT == BiomeTransistion.River);
            bool eCheck = (eBT == BiomeTransistion.River);
            bool wCheck = (wBT == BiomeTransistion.River);

            bool uCoast = (uBT == BiomeTransistion.Coast);
            bool eCoast = (eBT == BiomeTransistion.Coast);
            bool wCoast = (wBT == BiomeTransistion.Coast);

            int coastType = 3;

            if (uCoast || eCoast || wCoast)
            {
                coastType = 2;
            }


            if (uCheck && eCheck && wCheck)
            {
                graphics.buildRiverVertex(0, this.orientation, true, true, true, this.vertNum, position, secondPosition);
            }
            else if (uCheck && eCheck && !wCheck)
            {
                graphics.buildRiverVertex(1, this.orientation, true, true, false, this.vertNum, position, secondPosition);
            }
            else if (uCheck && !eCheck && wCheck)
            {
                graphics.buildRiverVertex(1, this.orientation, true, false, true, this.vertNum, position, secondPosition);
            }
            else if (!uCheck && eCheck && wCheck)
            {
                graphics.buildRiverVertex(1, this.orientation, false, true, true, this.vertNum, position, secondPosition);
            }
            else if (uCheck)
            {
                graphics.buildRiverVertex(coastType, this.orientation, true, false, false, this.vertNum, position, secondPosition);
            }
            else if (eCheck)
            {
                graphics.buildRiverVertex(coastType, this.orientation, false, true, false, this.vertNum, position, secondPosition);
            }
            else if (wCheck)
            {
                graphics.buildRiverVertex(coastType, this.orientation, false, false, true, this.vertNum, position, secondPosition);
            }
            else
            {
                graphics.buildRiverVertex(4, this.orientation, false, false, false, vertNum, position, secondPosition);
            }
        }
    }