From 03a82bbc670ae8851a5794dfd932d3936af63e3f Mon Sep 17 00:00:00 2001 From: austin Date: Sun, 5 Jan 2025 19:19:48 -0500 Subject: [PATCH] define needs hierarchy --- .../sim/character/Character.java | 15 + .../sim/character/needs/NeedsHierarchy.java | 298 ++++++++++++++++++ 2 files changed, 313 insertions(+) create mode 100644 src/main/java/org/studiorailgun/sim/character/needs/NeedsHierarchy.java diff --git a/src/main/java/org/studiorailgun/sim/character/Character.java b/src/main/java/org/studiorailgun/sim/character/Character.java index 9727a1b..d4f8e67 100644 --- a/src/main/java/org/studiorailgun/sim/character/Character.java +++ b/src/main/java/org/studiorailgun/sim/character/Character.java @@ -2,6 +2,7 @@ package org.studiorailgun.sim.character; import org.studiorailgun.Globals; import org.studiorailgun.sim.character.emotion.EmotionData; +import org.studiorailgun.sim.character.needs.NeedsHierarchy; import org.studiorailgun.sim.character.vis.CharacterAppearance; import org.studiorailgun.sim.space.Location; @@ -30,6 +31,11 @@ public class Character { */ EmotionData emotions; + /** + * The needs hierarchy for the character + */ + NeedsHierarchy needs; + /** * The id of the location of this character is in */ @@ -112,6 +118,15 @@ public class Character { return Globals.world.getLocation(this.locationId); } + public NeedsHierarchy getNeeds() { + return needs; + } + + public void setNeeds(NeedsHierarchy needs) { + this.needs = needs; + } + + } diff --git a/src/main/java/org/studiorailgun/sim/character/needs/NeedsHierarchy.java b/src/main/java/org/studiorailgun/sim/character/needs/NeedsHierarchy.java new file mode 100644 index 0000000..f093ea8 --- /dev/null +++ b/src/main/java/org/studiorailgun/sim/character/needs/NeedsHierarchy.java @@ -0,0 +1,298 @@ +package org.studiorailgun.sim.character.needs; + +/** + * Structure that stores the desires of a character + */ +public class NeedsHierarchy { + + // + //tier 1 needs + // + + /** + * How hungry the character is + */ + float hunger; + + /** + * How thirsty the character is + */ + float thirst; + + /** + * How sheltered the character feels + */ + float shelter; + + + + // + //tier 2 needs + // + + /** + * How likely the character feels that their tier 1 needs will continue to be met in the future + */ + float security; + + /** + * How likely the character feels they will be safe from harm in the immediate future + */ + float safety; + + + + // + //tier 3 needs + // + + /** + * How satisfied the character is with their social life + */ + float friendship; + + /** + * How satisfied the character is with their family life + */ + float family; + + + + // + //tier 4 needs + // + + /** + * How accomplished the character feels at their pursuits + */ + float accomplishment; + + /** + * How free the character feels + */ + float freedom; + + /** + * How high does the character perceive their status in society as being + */ + float status; + + + + + + + // + //tier 5 needs + // + + /** + * How much the character feels they have lived up to their potential + */ + float potential; + + + + + + + public float getHunger() { + return hunger; + } + + + + + + + public void setHunger(float hunger) { + this.hunger = hunger; + } + + + + + + + public float getThirst() { + return thirst; + } + + + + + + + public void setThirst(float thirst) { + this.thirst = thirst; + } + + + + + + + public float getShelter() { + return shelter; + } + + + + + + + public void setShelter(float shelter) { + this.shelter = shelter; + } + + + + + + + public float getSecurity() { + return security; + } + + + + + + + public void setSecurity(float security) { + this.security = security; + } + + + + + + + public float getSafety() { + return safety; + } + + + + + + + public void setSafety(float safety) { + this.safety = safety; + } + + + + + + + public float getFriendship() { + return friendship; + } + + + + + + + public void setFriendship(float friendship) { + this.friendship = friendship; + } + + + + + + + public float getFamily() { + return family; + } + + + + + + + public void setFamily(float family) { + this.family = family; + } + + + + + + + public float getAccomplishment() { + return accomplishment; + } + + + + + + + public void setAccomplishment(float accomplishment) { + this.accomplishment = accomplishment; + } + + + + + + + public float getFreedom() { + return freedom; + } + + + + + + + public void setFreedom(float freedom) { + this.freedom = freedom; + } + + + + + + + public float getStatus() { + return status; + } + + + + + + + public void setStatus(float status) { + this.status = status; + } + + + + + + + public float getPotential() { + return potential; + } + + + + + + + public void setPotential(float potential) { + this.potential = potential; + } + + + + + + + +}