[SOLVED] package dungeonmania.goals;

$25

File Name: package_dungeonmania.goals;.zip
File Size: 254.34 KB

5/5 - (1 vote)

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]

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] package dungeonmania.goals;
$25