-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e7eaea
commit 451678d
Showing
5 changed files
with
132 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package xyz.risingthumb.iff.classes; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class Group { | ||
private List<GroupPerson> persons; | ||
private String prefix = "XYZ"; | ||
|
||
public Group() { | ||
this.persons = new ArrayList<GroupPerson>(); | ||
this.prefix = "XYZ"; | ||
} | ||
public Group(String prefix) { | ||
this.persons = new ArrayList<GroupPerson>(); | ||
this.prefix = prefix; | ||
} | ||
public Group(List<GroupPerson> persons, String prefix) { | ||
this.persons = new ArrayList<GroupPerson>(); | ||
// Protective | ||
for(GroupPerson gp : persons) { | ||
this.persons.add(new GroupPerson(gp.getName())); | ||
} | ||
this.prefix = prefix; | ||
} | ||
|
||
public void addPerson(GroupPerson person) { | ||
this.persons.add(person); | ||
} | ||
|
||
public void removePerson(int personIndex) { | ||
this.persons.remove(personIndex); | ||
} | ||
|
||
public void setPrefix(String prefix) { | ||
this.prefix = prefix; | ||
} | ||
public String getName() { | ||
return this.prefix; | ||
} | ||
public int size() { | ||
return persons.size(); | ||
} | ||
public GroupPerson getPerson(int index) { | ||
return persons.get(index); | ||
} | ||
public List<GroupPerson> getPersons() { | ||
return persons; | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
src/main/java/xyz/risingthumb/iff/classes/GroupManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package xyz.risingthumb.iff.classes; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class GroupManager { | ||
private List<Group> groups; | ||
private int groupIndex = 0; | ||
|
||
public GroupManager() { | ||
this.groups = new ArrayList<Group>(); | ||
} | ||
|
||
public void addGroup(Group group) { | ||
this.groups.add(group); | ||
} | ||
public void removeGroup(int indexToRemove) { | ||
// We remove based on index | ||
this.groups.remove(indexToRemove); | ||
modifyGroupIndex(-1); | ||
} | ||
public void modifyGroupIndex(int changeValue) { | ||
this.groupIndex+=changeValue; | ||
// If there's no groups. literally do nothing | ||
if (groups.size()==0) { | ||
this.groupIndex = 0; | ||
return; | ||
} | ||
// Bounds | ||
if (groupIndex < 0) { | ||
groupIndex = groups.size()-1; | ||
} | ||
if (groupIndex >= groups.size()) { | ||
groupIndex = 0; | ||
} | ||
} | ||
|
||
public int getSize() { | ||
return groups.size(); | ||
} | ||
|
||
public String getNameOfGroup(int index) { | ||
return groups.get(index).getName(); | ||
} | ||
|
||
public Group getGroup(int index) { | ||
return groups.get(index); | ||
} | ||
|
||
public List<Group> getGroups() { | ||
return groups; | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/xyz/risingthumb/iff/classes/GroupPerson.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package xyz.risingthumb.iff.classes; | ||
|
||
public class GroupPerson { | ||
String name; | ||
|
||
public GroupPerson(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package xyz.risingthumb.iff.classes; | ||
|
||
public class Settings { | ||
public static boolean cancel = false; | ||
public static boolean moveToLoc = false; | ||
public static boolean lootChest = false; | ||
public static boolean cancelLootChest = false; | ||
} |