Package colonies.src.citizens

Examples of colonies.src.citizens.EntityCitizen


    Utility.Debug("Evacuating " + townname);
    maxPopulation = 0;
   
    // remove citizens from town
    while(!citizensList.isEmpty()){
      EntityCitizen tmp = citizensList.getFirst();
      tmp.hasHomeTown = false;
      citizensList.removeFirst();
      Utility.Debug("Citizen left town");
    }
   
View Full Code Here


        if(--spawnDelay <= 0){
          spawnDelay = 500;
          // Utility.Debug(townName + " spawner triggered");
          // Choose citizen type to spawn (default wanderer or wife)
             EntityCitizen newGuy;
             if(isLessFemales()){
               newGuy = new EntityWife(worldObj);
             }
             else{
               newGuy = new EntityCitizen(worldObj);
             }
         
             newGuy.giveName();
            
          // pick a random direction at the town perimeter
          Point p = new Point(this.xCoord, this.yCoord, this.zCoord);
          Point q = new Point();
          Utility.Debug(p.toString());
          q.polarTranslation(Utility.rng.nextRadian(), (float)(Math.PI/2.2), 14d);
          p.plus(q);
          this.terrainAdjustment(p);

          // spawn mob
            newGuy.setLocationAndAngles(Math.floor(p.x), Math.floor(p.y), Math.floor(p.z), Utility.rng.nextFloat()*360.0f, 0.0f);
            worldObj.spawnEntityInWorld(newGuy);
        }
       
        /*
        // Load/Save
View Full Code Here

  }

  public boolean getNextJob(EntityCitizen _citizen) {
    if(employersList == null || employersList.isEmpty()) return false;
   
    EntityCitizen newJob = null;
    for(TileEntityColoniesChest jobSite : employersList){
      if(jobSite.applyForJob(_citizen)){
        // citizen hired and converted
        return true;
      } // else didn't get hired
View Full Code Here

        // found empty job.
       
        // is candidate disqualified?
        if(!candidate.isMale) return false;
             
        EntityCitizen newCitizen = createNewWorker(candidate.worldObj);
        candidate.setNewJob(newCitizen);
       
        newCitizen.employer = this;
        availablePosition = newCitizen;
       
        Utility.chatMessage("Citizen #" + candidate.ssn + " hired as "+newCitizen.getJobTitle()+ " #"+newCitizen.ssn);
        return true;
      }// else position already occupied
    }
    return false;
  }
View Full Code Here

    }
    return false;
  }
  // Override for various building types
  protected EntityCitizen createNewWorker(World theWorld){
    return new EntityCitizen(theWorld);
 
View Full Code Here

        this.evictOccupants();
    }
   
    private void evictOccupants(){
      if(occupants == null) return;
      EntityCitizen evictedTennant;
      while(!occupants.isEmpty()){
        evictedTennant = occupants.getFirst();
        evictedTennant.residence = null;
        occupants.removeFirst();
      }
View Full Code Here

    for(EntityCitizen employee : jobPositions){
      if(employee != null){
        employee.employer = null;
       
        if(employee.isMale){
          employee.setNewJob(new EntityCitizen(employee.worldObj));
        }
        else{
          employee.setNewJob(new EntityWife(employee.worldObj));
        }
       
View Full Code Here

TOP

Related Classes of colonies.src.citizens.EntityCitizen

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.