Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/areaRepo #16

Merged
merged 6 commits into from Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/Gradle__ch_qos_logback_logback_core_1_2_3.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/Gradle__junit_junit_4_11.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_25.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__junit_junit_4_11.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/modules/text-adventure.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/modules/text-adventure.main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/modules/text-adventure.test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -3,7 +3,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


import xyz.devosmium.games.textadventureengine.menus.MainMenu;

/**
Expand All @@ -12,6 +11,7 @@
*/
public class App {
private static Logger logger = LoggerFactory.getLogger(App.class);
private static AreaCollection areas;


public static void main(String[] args) {
Expand Down
Expand Up @@ -2,6 +2,7 @@

import xyz.devosmium.games.textadventureengine.commands.EngineCommandManager;
import xyz.devosmium.games.textadventureengine.exceptions.DeathException;
import xyz.devosmium.games.textadventureengine.locations.World;
import xyz.devosmium.games.textadventureengine.menus.MainMenu;
import xyz.devosmium.games.textadventureengine.mobiles.Player;
import xyz.devosmium.games.textadventureengine.util.MessageQueue;
Expand Down
Expand Up @@ -4,38 +4,25 @@

public class Area {

private String name;

private ArrayList<Location> locations;

public Area(String name) {
this.name = name;
locations = new ArrayList<Location>();
private String areaName;
private int areaID;
private ArrayList<Location> areaLocations;

public Area(String areaName, int areaID) {
this.areaName = areaName;
this.areaID = areaID;
areaLocations = new ArrayList<Location>();
}

public void registerLocation(Location location) {
locations.add(location);
public int getAreaID() {
return areaID;
}

public ArrayList<Location> getLocationList() {
return locations;
public String getAreaName() {
return areaName;
}

/**
* Searchs the registered locations by name
* @param name The name of the location (short string)
* @return Location if it's been registered, or null
*/
public Location getLocationByName(String name) {
for (Location loc : locations) {
if (loc.getShort().equals(name)) {
return loc;
} else {
continue;
}
}
return null;
public void registerLocation(Location location) {
areaLocations.add(location);
}


}