代写代考 package dungeonmania.map;

package dungeonmania.map;

import org.json.JSONObject;

Copyright By PowCoder代写 加微信 powcoder

import dungeonmania.entities.EntityFactory;

public class GraphNodeFactory {
public static GraphNode createEntity(JSONObject jsonEntity, EntityFactory factory) {
return constructEntity(jsonEntity, factory);

private static GraphNode constructEntity(JSONObject jsonEntity, EntityFactory factory) {
switch (jsonEntity.getString(“type”)) {
case “player”:
case “zombie_toast”:
case “zombie_toast_spawner”:
case “mercenary”:
case “wall”:
case “boulder”:
case “switch”:
case “exit”:
case “treasure”:
case “wood”:
case “arrow”:
case “bomb”:
case “invisibility_potion”:
case “invincibility_potion”:
case “portal”:
case “sword”:
case “spider”:
case “door”:
case “key”:
return new GraphNode(factory.createEntity(jsonEntity));
return null;

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com