コード例 #1
0
  public void msgRestaurantFull(int waitingSpot) {
    this.waitingSpot = waitingSpot;
    int randomChoice = ranGenerator.nextInt(6);

    // Hacks to demonstrate working code. "patient" will always wait while "impatient" will leave
    if (name.equals("patient")) {
      log("I'm in no hurry, I'll wait around.");
      goingInside = true;
      person.stateChanged();
      return;
    }
    if (name.equals("impatient")) {
      log("I don't have time to wait around!");
      event = AgentEvent.leaving;
      person.stateChanged();
      return;
    }

    if (randomChoice == 0) {
      log("I don't have time to wait around!");
      event = AgentEvent.leaving;
    } else if (randomChoice > 0) {
      log("I'm in no hurry, I'll wait around.");
      goingInside = true;
    }
    person.stateChanged();
  }
コード例 #2
0
ファイル: LandlordRole.java プロジェクト: trevorar/SimCity
 // ACTIONS
 private void collectRent(MyTenant mt) {
   if (!test) {
     log("Collecting rent now");
   }
   mt.tenant.msgRentDue(this, mt.rate);
   mt.newPayment = false;
   p.stateChanged();
 }
コード例 #3
0
 public void msgAtDestination() {
   atDestination.release();
   person.stateChanged();
 }
コード例 #4
0
 public void msgAnimationDoneLeaving() {
   event = AgentEvent.leaving;
   person.stateChanged();
 }
コード例 #5
0
 public void msgHereIsYourFood(String choice) {
   event = AgentEvent.startedEating;
   person.stateChanged();
 }
コード例 #6
0
 public void msgHereIsChange(double change) {
   money += change;
   event = AgentEvent.leaving;
   person.stateChanged();
 }
コード例 #7
0
 public void msgHereIsYourBill(Restaurant1Check c) {
   check = c;
   person.stateChanged();
 }
コード例 #8
0
 public void msgPleaseReorder() {
   event = AgentEvent.reordering;
   person.stateChanged();
 }
コード例 #9
0
 public void msgAtBuilding() { // from animation
   // print("msgAtBuilding() called");
   atBuilding.release(); // = true;
   stateChanged();
 }
コード例 #10
0
 public void msgAnimationFinishedGoToSeat() {
   // from animation
   event = AgentEvent.seated;
   person.stateChanged();
 }
コード例 #11
0
 public void msgFollowMe(Restaurant1WaiterRole w, Restaurant1Menu m) {
   waiter = w;
   menu = m;
   event = AgentEvent.followWaiter;
   person.stateChanged();
 }
コード例 #12
0
 public void msgGotHungry() { // from animation
   log("I'm hungry");
   event = AgentEvent.gotHungry;
   person.stateChanged();
 }
コード例 #13
0
 public void msgFeelFreeToWait(int spot) {
   waitingSpot = spot;
   person.stateChanged();
 }
コード例 #14
0
 public void msgAtEntrance() { // from animation
   // print("msgAtEntrance() called");
   atEntrance.release(); // = true;
   stateChanged();
 }
コード例 #15
0
 public void msgWhatDoYouWant() {
   event = AgentEvent.askedToOrder;
   person.stateChanged();
 }
コード例 #16
0
ファイル: LandlordRole.java プロジェクト: trevorar/SimCity
 public void deactivate() {
   setRoleInactive = false;
   p.setRoleInactive(this);
   p.setGuiVisible();
   p.stateChanged();
 }
コード例 #17
0
 public void msgFire() {
   emergencyState = EmergencyState.fire;
   stateChanged();
 }