Package civquest.io

Examples of civquest.io.Messages


  return false;
    }

    private void computePlates() {
   
    Messages messages = Messages.getMessages();
    platesize = 0;
    for(int y = 0;y < height;y++)
      for(int x = 0;x < width;x++)
        if((mapdata.isArrayCoordOnMap(x,y)) && (platemap[y][x] == config.NOPLATE))
          {
            Plate newplate = createPlate();
            int number = newplate.getNumber();
            int size = growPlate(x,y,number);
     
            messages.info("PHGenerator", "PHGenPlates",
                    "Created new plate with number " + number
                    + " and size " + size);
            newplate.setSize(size);
            platesize += size;
          }
    messages.info("PHGenerator", "PHGenPlates", "platesize = " + platesize);
  }
View Full Code Here


        }
      }
    }

    private void computePlateProperties() {
    Messages messages = Messages.getMessages();

    sealandcreator.computeSeaLand();
    for(int n = 0;n < plates.size();n++) {
        Plate currplate = (Plate)(plates.get(n));
        currplate.setMoveDirection(new Coordinate(randomgen.nextInt(3) - 1,
                              randomgen.nextInt(3) - 1));
        // movedirection: (k,l) with k,l out of {-1,0,1}

        String modString;
        if(currplate.isSea()) {
          modString = " is sea ";
        } else {
          modString = " is land ";
        }

        Coordinate movedir = currplate.getMoveDirection();
          modString += "and moves with direction " + movedir.x + "," + movedir.y;
       
        messages.info("PHGenerator", "PHGenPlates",
                "Plate " + currplate.getNumber() + modString);
      }
    }
View Full Code Here

          {
        Coordinate maxmovedir = maxplate.getMoveDirection();
        Coordinate newmovedir = new Coordinate(maxmovedir.x,maxmovedir.y);
        currplate.setMoveDirection(newmovedir);

        Messages messages = Messages.getMessages();
        messages.info("PHGenerator", "PHGenPlates",
                "Changing direction of plate "
                + currplate.getNumber() + " to the one of "
                + "plate " + maxplate.getNumber());
        messages.info("PHGenerator", "PHGenPlates",
                "--> New direction is " + newmovedir.x
                + "," + newmovedir.y);
          }
                 
        }
View Full Code Here

        curredge.dump();
      }
    }

    public void dumpPlates() {
    Messages messages = Messages.getMessages();

    messages.info("PHGenerator", "PHGenPlates", "dumpPlates: Plate-directions:");

    StringBuffer minusLine = new StringBuffer();

    for(int x = 0;x < width;x++) {
      minusLine.append("-");
    }

    messages.info("PHGenerator", "PHGenPlates", minusLine.toString());

    for(int y = 0;y < height;y++) {
      StringBuffer currLine = new StringBuffer();
      currLine.append("|");
      for(int x = 0;x < width;x++) {     
        if(platemap[y][x] < 0) {
          currLine.append("X");
        } else if (platemap[y][x] == 0) {
          currLine.append(" ");
        } else {
          Plate currplate = getPlate(platemap[y][x]);
          Coordinate cmd = currplate.getMoveDirection();
          if(cmd.equals(-1,-1))
            currLine.append("1");
          if(cmd.equals(0,-1))
            currLine.append("2");
          if(cmd.equals(1,-1))
            currLine.append("3");
          if(cmd.equals(-1,0))
            currLine.append("4");
          if(cmd.equals(0,0))
            currLine.append("5");
          if(cmd.equals(1,0))
            currLine.append("6");
          if(cmd.equals(-1,1))
            currLine.append("7");
          if(cmd.equals(0,1))
            currLine.append("8");
          if(cmd.equals(1,1))
            currLine.append("9");
        }
        }
      currLine.append("| " + y);

      messages.info("PHGenerator", "PHGenPlates", currLine.toString());
      }

    messages.info("PHGenerator", "PHGenPlates", minusLine.toString());
    }
View Full Code Here

    messages.info("PHGenerator", "PHGenPlates", minusLine.toString());
    }
   
    public void dumpMapData() {
    Messages messages = Messages.getMessages();

    messages.info("PHGenerator", "PHGenHeights", "dumpMapData: Generated height-levels");

    StringBuffer minusLine = new StringBuffer();

    for(int x = 0;x < width;x++) {
      minusLine.append("-");
    }
   
    messages.info("PHGenerator", "PHGenHeights", minusLine.toString());

    for(int y = 0;y < height;y++) {
      StringBuffer currLine = new StringBuffer();
      currLine.append("|");
      for(int x = 0;x < width;x++) {
        if(!mapdata.isArrayCoordOnMap(x,y))
          currLine.append(" ");
        if(hgmapdata.isPlain(x,y))
          currLine.append("P");
        if(hgmapdata.isHills(x,y))
          currLine.append("H");
        if(hgmapdata.isMountains(x,y))
          currLine.append("m");
        if(hgmapdata.isHighMountains(x,y))
          currLine.append("M");
        if(hgmapdata.isLandVolcano(x,y))
          currLine.append("V");

        if(hgmapdata.isShallowSea(x,y))
          currLine.append("s");
        if(hgmapdata.isNormalSea(x,y))
          currLine.append("S");
        if(hgmapdata.isDeepSea(x,y))
          currLine.append("D");
        if(hgmapdata.isSeaMountain(x,y))
          currLine.append("U");
        if(hgmapdata.isSeaVolcano(x,y))
          currLine.append("v");
        }
      currLine.append("| " + y);
      messages.info("PHGenerator", "PHGenHeights", currLine.toString());
      }

    messages.info("PHGenerator", "PHGenHeights", minusLine.toString());
    }
View Full Code Here

TOP

Related Classes of civquest.io.Messages

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.