Examples of Odds


Examples of me.daddychurchill.CityWorld.Support.Odds

  }
 
  public void populate(WorldGenerator generator, PlatMap platmap) {

    // grab platmap's random
    Odds odds = platmap.getOddsGenerator();
   
    // for each schematic
    for (Clipboard clip: this) {

      // that succeeds the OddsOfAppearance
      if (odds.playOdds(clip.oddsOfAppearance)) {
        platmap.placeSpecificClip(generator, odds, clip);
      }
    }
  }
View Full Code Here

Examples of me.daddychurchill.CityWorld.Support.Odds

    // initialize the shaping logic
    if (world == null) {
      world = aWorld;
      settings = new CityWorldSettings(this);
      worldSeed = world.getSeed();
      connectionKeyGen = new Odds(getRelatedSeed());

      shapeProvider = ShapeProvider.loadProvider(this, new Odds(getRelatedSeed()));
      lootProvider = LootProvider.loadProvider(this);
      spawnProvider = SpawnProvider.loadProvider(this);
      oreProvider = OreProvider.loadProvider(this);
      coverProvider = CoverProvider.loadProvider(this, new Odds(getRelatedSeed()));
      odonymProvider = OdonymProvider.loadProvider(this, new Odds(getRelatedSeed()));
      surfaceProvider = SurfaceProvider.loadProvider(this, new Odds(getRelatedSeed()));
      balloonProvider = BalloonProvider.loadProvider(this);
      houseProvider = HouseProvider.loadProvider(this);
      treeProvider = TreeProvider.loadProvider(this, new Odds(getRelatedSeed()));
      pasteProvider = PasteProvider.loadProvider(this);
      decayBlocks = new WorldBlocks(this, new Odds(getRelatedSeed()));
     
      // get ranges and contexts
      height = shapeProvider.getWorldHeight();
      seaLevel = shapeProvider.getSeaLevel();
      landRange = shapeProvider.getLandRange();
View Full Code Here

Examples of me.daddychurchill.CityWorld.Support.Odds

    //TODO, Nature doesn't handle schematics quite right yet
    // let the user add their stuff first, then plug any remaining holes with our stuff
    //mapsSchematics.populate(generator, platmap);
   
    // random fluff
    Odds odds = platmap.getOddsGenerator();
    ShapeProvider shapeProvider = generator.shapeProvider;
   
    // where it all begins
    int originX = platmap.originX;
    int originZ = platmap.originZ;
    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;
         
          // get the height info for this chunk
          heights = HeightInfo.getHeightsFaster(generator, blockX, blockZ);
          if (!heights.isBuildable()) {
           
            // our inner chunks?
            if (x > 0 && x < PlatMap.Width - 1 && z > 0 && z < PlatMap.Width - 1) {
             
              // floating building?
              if (generator.settings.includeHouses) {
                if (shapeProvider.isIsolatedConstructAt(originX + x, originZ + z, oddsOfIsolatedConstructs))
                  current = new FloatingHouseLot(platmap, originX + x, originZ + z,
                      shapeProvider.getConstuctMin() + odds.getRandomInt(shapeProvider.getConstuctRange()));
              }
            }
           
            // did current get defined?
            if (current != null)
View Full Code Here

Examples of me.daddychurchill.CityWorld.Support.Odds

  @Override
  public void populateMap(WorldGenerator generator, PlatMap platmap) {
   
    // now add our stuff
    Odds platmapOdds = platmap.getOddsGenerator();
    ShapeProvider shapeProvider = generator.shapeProvider;
    boolean housePlaced = false;
    int lastX = 0, lastZ = 0;
   
    // where do we begin?
    int originX = platmap.originX;
    int originZ = platmap.originZ;
   
    // clean up the platmap of singletons and odd road structures
    for (int x = 0; x < PlatMap.Width; x++) {
      for (int z = 0; z < PlatMap.Width; z++) {
        PlatLot current = platmap.getLot(x, z);
       
        // something here?
        if (current == null) {
         
          // but there aren't neighbors
          if (!platmap.isEmptyLot(x - 1, z) && !platmap.isEmptyLot(x + 1, z) &&
            !platmap.isEmptyLot(x, z - 1) && !platmap.isEmptyLot(x, z + 1))
            platmap.recycleLot(x, z);
        }
       
        // look for singleton nature and roundabouts
        else {
         
          // if a single natural thing is here but surrounded by four "things"
          if (current.style == LotStyle.NATURE &&
            platmap.isEmptyLot(x - 1, z) && platmap.isEmptyLot(x + 1, z) &&
            platmap.isEmptyLot(x, z - 1) && platmap.isEmptyLot(x, z + 1))
            platmap.emptyLot(x, z);
         
          // get rid of roundabouts
          else if (current.style == LotStyle.ROUNDABOUT) {
            platmap.paveLot(x, z, false);
            platmap.emptyLot(x - 1, z - 1);
            platmap.emptyLot(x - 1, z + 1);
            platmap.emptyLot(x + 1, z - 1);
            platmap.emptyLot(x + 1, z + 1);
          }
        }
      }
    }
   
    // let the user add their stuff first
    getSchematics(generator).populate(generator, platmap);
   
    // backfill with farms and a single house
    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 Barns and Wells
         
          // farm house here?
          if (!housePlaced && platmapOdds.playOdds(oddsOfFarmHouse) && generator.settings.includeHouses) {
            housePlaced = platmap.setLot(x, z, getHouseLot(generator, platmap, platmapOdds, originX + lastX, originZ + lastZ));
         
          // place the farm
          } else {
           
View Full Code Here

Examples of me.daddychurchill.CityWorld.Support.Odds

    //TODO, Nature doesn't handle schematics quite right yet
    // let the user add their stuff first, then plug any remaining holes with our stuff
    //mapsSchematics.populate(generator, platmap);
   
    // random stuff?
    Odds platmapOdds = platmap.getOddsGenerator();
    boolean doBunkers = generator.settings.includeBunkers && platmapOdds.playOdds(oddsOfBunkers);
    boolean didBunkerEntrance = false;
   
    // where it all begins
    int originX = platmap.originX;
    int originZ = platmap.originZ;
View Full Code Here

Examples of me.daddychurchill.CityWorld.Support.Odds

  private boolean microBooleanAt(double chunkX, double chunkZ, int slot) {
    return getMicroNoiseAt(chunkX, chunkZ, slot) >= 0.0;
  }
 
  public Odds getMicroOddsGeneratorAt(int x, int z) {
    return new Odds((long) (getMicroNoiseAt(x, z, microRandomGeneratorSlot) * Long.MAX_VALUE));
  }
 
View Full Code Here

Examples of me.daddychurchill.CityWorld.Support.Odds

  public Odds getMicroOddsGeneratorAt(int x, int z) {
    return new Odds((long) (getMicroNoiseAt(x, z, microRandomGeneratorSlot) * Long.MAX_VALUE));
  }
 
  public Odds getMacroOddsGeneratorAt(int x, int z) {
    return new Odds((long) (getMacroNoiseAt(x, z, macroRandomGeneratorSlot) * Long.MAX_VALUE));
  }
 
View Full Code Here

Examples of me.daddychurchill.CityWorld.Support.Odds

   
    // where it all begins
    int originX = platmap.originX;
    int originZ = platmap.originZ;
    HeightInfo heights;
    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);
View Full Code Here

Examples of me.daddychurchill.CityWorld.Support.Odds

  }

  public PlatLot createRoundaboutStatueLot(WorldGenerator generator, PlatMap platmap, int x, int z) {

    // grab potential platlot's random
    Odds odds = platmap.getChunkOddsGenerator(platmap.originX + x, platmap.originZ + z);
   
    // what way are we facing?
    BlockFace facing = odds.getRandomFacing();
   
    // see if there is a schematic out there that fits
    Clipboard clip = getSchematics(generator).getSingleLot(generator, platmap, odds, x, z);
    if (clip != null) {
     
View Full Code Here

Examples of me.daddychurchill.CityWorld.Support.Odds

   
    // let the user add their stuff first, then plug any remaining holes with our stuff
    getSchematics(generator).populate(generator, platmap);
   
    // random fluff!
    Odds platmapOdds = platmap.getOddsGenerator();
    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);
           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.