package dungeonmania.goals;
import org.json.JSONArray;
import org.json.JSONObject;
Copyright By Assignmentchef assignmentchef
public class GoalFactory {
public static Goal createGoal(JSONObject jsonGoal, JSONObject config) {
JSONArray subgoals;
switch (jsonGoal.getString(goal)) {
case AND:
subgoals = jsonGoal.getJSONArray(subgoals);
return new Goal(
createGoal(subgoals.getJSONObject(0), config),
createGoal(subgoals.getJSONObject(1), config)
case OR:
subgoals = jsonGoal.getJSONArray(subgoals);
return new Goal(
createGoal(subgoals.getJSONObject(0), config),
createGoal(subgoals.getJSONObject(1), config)
case exit:
return new Goal(exit);
case boulders:
return new Goal(boulders);
case treasure:
int treasureGoal = config.optInt(treasure_goal, 1);
return new Goal(treasure, treasureGoal);
return null;
CS: assignmentchef QQ: 1823890830 Email: [email protected]

![[SOLVED] package dungeonmania.goals;](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[SOLVED] Programming Project for TCP Socket Programming](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.