Package me.daddychurchill.CityWorld.Plats

Examples of me.daddychurchill.CityWorld.Plats.PlatLot


    boolean towerPlaced = false;
   
    // is this natural or buildable?
    for (int x = 0; x < PlatMap.Width; x++) {
      for (int z = 0; z < PlatMap.Width; z++) {
        PlatLot current = platmap.getLot(x, z);
        if (current == null) {
       
          // what is the world location of the lot?
          int blockX = (originX + x) * SupportChunk.chunksBlockWidth;
          int blockZ = (originZ + z) * SupportChunk.chunksBlockWidth;
 
View Full Code Here


    ShapeProvider shapeProvider = generator.shapeProvider;
   
    // backfill with buildings and parks
    for (int x = 0; x < PlatMap.Width; x++) {
      for (int z = 0; z < PlatMap.Width; z++) {
        PlatLot current = platmap.getLot(x, z);
        if (current == null) {
         
          //TODO I need to come up with a more elegant way of doing this!
          if (generator.settings.includeBuildings) {

            // what to build?
            boolean buildPark = platmapOdds.playOdds(oddsOfParks);
            if (buildPark)
              current = getPark(generator, platmap, platmapOdds, platmap.originX + x, platmap.originZ + z);
            else
              current = getBackfillLot(generator, platmap, platmapOdds, platmap.originX + x, platmap.originZ + z);
           
            // see if the previous chunk is the same type
            PlatLot previous = null;
            if (x > 0 && current.isConnectable(platmap.getLot(x - 1, z))) {
              previous = platmap.getLot(x - 1, z);
            } else if (z > 0 && current.isConnectable(platmap.getLot(x, z - 1))) {
              previous = platmap.getLot(x, z - 1);
            }
           
            // if there was a similar previous one then copy it... maybe
            if (previous != null && !shapeProvider.isIsolatedLotAt(platmap.originX + x, platmap.originZ + z, oddsOfIsolatedLots)) {
              current.makeConnected(previous);
             
            // 2 by 2 at a minimum if at all possible
            } else if (!buildPark && x < PlatMap.Width - 1 && z < PlatMap.Width - 1) {
             
              // is there room?
              PlatLot toEast = platmap.getLot(x + 1, z);
              PlatLot toSouth = platmap.getLot(x, z + 1);
              PlatLot toSouthEast = platmap.getLot(x + 1, z + 1);
              if (toEast == null && toSouth == null && toSouthEast == null) {
                toEast = current.newLike(platmap, platmap.originX + x + 1, platmap.originZ + z);
                toEast.makeConnected(current);
                platmap.setLot(x + 1, z, toEast);

                toSouth = current.newLike(platmap, platmap.originX + x, platmap.originZ + z + 1);
                toSouth.makeConnected(current);
                platmap.setLot(x, z + 1, toSouth);

                toSouthEast = current.newLike(platmap, platmap.originX + x + 1, platmap.originZ + z + 1);
                toSouthEast.makeConnected(current);
                platmap.setLot(x + 1, z + 1, toSouthEast);
              }
            }
          }

          // remember what we did
          if (current != null)
            platmap.setLot(x, z, current);
        }
      }
    }

    // validate each lot
    for (int x = 0; x < PlatMap.Width; x++) {
      for (int z = 0; z < PlatMap.Width; z++) {
        PlatLot current = platmap.getLot(x, z);
        if (current != null) {
          PlatLot replacement = current.validateLot(platmap, x, z);
          if (replacement != null)
            platmap.setLot(x, z, replacement);
        }
      }
    }
View Full Code Here

    HeightInfo heights;
   
    // is this natural or buildable?
    for (int x = 0; x < PlatMap.Width; x++) {
      for (int z = 0; z < PlatMap.Width; z++) {
        PlatLot current = platmap.getLot(x, z);
        if (current == null) {
       
          // what is the world location of the lot?
          int blockX = (originX + x) * SupportChunk.chunksBlockWidth;
          int blockZ = (originZ + z) * SupportChunk.chunksBlockWidth;
 
View Full Code Here

    HeightInfo heights;
   
    // is this natural or buildable?
    for (int x = 0; x < PlatMap.Width; x++) {
      for (int z = 0; z < PlatMap.Width; z++) {
        PlatLot current = platmap.getLot(x, z);
        if (current == null) {
         
          // what is the world location of the lot?
          int blockX = (originX + x) * SupportChunk.chunksBlockWidth;
          int blockZ = (originZ + z) * SupportChunk.chunksBlockWidth;
 
View Full Code Here

  @Override
  public void validateMap(WorldGenerator generator, PlatMap platmap) {
    Odds platmapOdds = platmap.getOddsGenerator();
    for (int x = 0; x < PlatMap.Width; x++) {
      for (int z = 0; z < PlatMap.Width; z++) {
        PlatLot current = platmap.getLot(x, z);
       
        // if we are trulyIsolated and one of our neighbors are as well then recycle the lot
        if (current != null &&
          current.style == LotStyle.STRUCTURE &&
          current.trulyIsolated && !platmap.isTrulyIsolatedLot(x, z)) {
View Full Code Here

    boolean towerPlaced = false;
   
    // is this natural or buildable?
    for (int x = 0; x < PlatMap.Width; x++) {
      for (int z = 0; z < PlatMap.Width; z++) {
        PlatLot current = platmap.getLot(x, z);
        if (current == null) {
       
          // what is the world location of the lot?
          int blockX = (originX + x) * SupportChunk.chunksBlockWidth;
          int blockZ = (originZ + z) * SupportChunk.chunksBlockWidth;
 
View Full Code Here

    boolean addingBases = false;
   
    // is this natural or buildable?
    for (int x = 0; x < PlatMap.Width; x++) {
      for (int z = 0; z < PlatMap.Width; z++) {
        PlatLot current = platmap.getLot(x, z);
        if (current == null) {
         
          // what is the world location of the lot?
          int blockX = (originX + x) * SupportChunk.chunksBlockWidth;
          int blockZ = (originZ + z) * SupportChunk.chunksBlockWidth;
 
View Full Code Here

    boolean checkForRoads = platmap.getNumberOfRoads() > 0;
   
    // backfill with buildings and parks
    for (int x = 0; x < PlatMap.Width; x++) {
      for (int z = 0; z < PlatMap.Width; z++) {
        PlatLot current = platmap.getLot(x, z);
        if (current == null) {
         
          // make houses? but only if they are right beside a road
          if (generator.settings.includeHouses) {
           
View Full Code Here

    // calculate neighbors
    updateNeighbors(platmap, platX, platZ);
  }
 
  protected void updateNeighbors(PlatMap platmap, int platX, int platZ) {
    PlatLot platlot = platmap.getLot(platX, platZ)
   
    // get a list of qualified neighbors
    PlatLot[][] neighborChunks = platlot.getNeighborPlatLots(platmap, platX, platZ, false);
    for (int x = 0; x < 3; x++) {
      for (int z = 0; z < 3; z++) {
        PlatLot neighbor = neighborChunks[x][z];

        // beyond the edge
        if (neighbor == null) {
          roads[x][z] = platX == RoadLot.PlatMapRoadInset - 1 ||
                  platZ == RoadLot.PlatMapRoadInset - 1 ||
View Full Code Here

    Odds odds = platmap.getOddsGenerator();
   
    // is this natural or buildable?
    for (int x = 0; x < PlatMap.Width; x++) {
      for (int z = 0; z < PlatMap.Width; z++) {
        PlatLot current = platmap.getLot(x, z);
        if (current == null) {
         
          // what is the world location of the lot?
          int blockX = (originX + x) * SupportChunk.chunksBlockWidth;
          int blockZ = (originZ + z) * SupportChunk.chunksBlockWidth;
 
View Full Code Here

TOP

Related Classes of me.daddychurchill.CityWorld.Plats.PlatLot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.