class Character { // Put name, personality, etc info in here too String name = ""; // Holds the EmoBranch (where on the dial) and strength (how far in/out) EmoState state = new EmoState(-1); // Used for detecting loading new image and probably other things in the future ArrayList hist = new ArrayList(); InteractionsDB interacts; // location for drawing int xpos = 100; int ypos = 200; Character(String name, InteractionsDB db) { this.name = name; interacts = db; } // void setEmoState(EmoState estate) { hist.add(state.copyCurrState()); state = estate.copyCurrState(); } void setEmoState(int stateID) { setEmoState(new EmoState(stateID)); } void drawInteracts() { int xposInteracts = 350; int yposInteracts = 40; textFont(fontBig); fill(0, 0, 0); text("Interactions:", xposInteracts, yposInteracts); // Draw all the interactions! int i = 0; Iterator it = interacts.hm.entrySet().iterator(); while (it.hasNext()) { Map.Entry me = (Map.Entry)it.next(); EmoAction interAct = (EmoAction)me.getValue(); textFont(fontSmall); interAct.x = xposInteracts +5; interAct.y = (yposInteracts+15) + (i*25); interAct.h = 22; stroke (0); if (mouseX < interAct.x || mouseX > (interAct.x + interAct.w) || mouseY < interAct.y || mouseY > (interAct.y + interAct.h)) fill(245); else fill(125); rect(interAct.x, interAct.y, interAct.w, interAct.h); fill(0); triangle(interAct.x + interAct.w+10, interAct.y + interAct.h - 20, interAct.x + interAct.w+10, interAct.y + interAct.h - 10, interAct.x + interAct.w+2, interAct.y + interAct.h-15); line(interAct.x + interAct.w+2, interAct.y + interAct.h-15, interAct.x + interAct.w+20, interAct.y + interAct.h-15); fill(0, 0, 0); text(interAct.name, interAct.x+10, interAct.y+15); i++; } } }