diff --git a/src/main/java/cactusServer/entities/Instance.java b/src/main/java/cactusServer/entities/Instance.java index c1457dd..650f494 100644 --- a/src/main/java/cactusServer/entities/Instance.java +++ b/src/main/java/cactusServer/entities/Instance.java @@ -48,25 +48,6 @@ setState(state); setStage(stageModel); } - - /** - * InstancesRest�Ƃ̃G���[�����p (��ŏ���) - * @param name - * @param state - */ - public Instance(String name, State state) { - this.name = name; - this.state = state; - } - - /** - * InstancesRest�Ƃ̃G���[�����p (��ŏ���) - * @param name - */ - public Instance(String name) { - this.name = name; - this.state = State.AVAILABLE; - } public String getName() { return name; @@ -85,6 +66,7 @@ return areaMap.keySet(); } + @JSONHint(ignore = true) public Area getArea(String areaId) { return areaMap.get(areaId); } @@ -94,35 +76,21 @@ return objMap.keySet(); } + @JSONHint(ignore = true) public Object getObject(String objId) { return objMap.get(objId); } -// @JSONHint(ignore = true) -// public List getActiveCharacters() { -// List activeCharacterList = new ArrayList<>(); -// for (Map.Entry entry : characterMap.entrySet()) { -// Character character = entry.getValue(); -// if (character.isActive()) { -// activeCharacterList.add(character); -// } -// } -// return activeCharacterList; -// } - -// public List getCharacters(String accountUniqueId) { -// List accountCharacterList = new ArrayList<>(); -// for (Map.Entry entry : characterMap.entrySet()) { -// Character character = entry.getValue(); -// URI accountURI = character.getAccountURI(); -// if (accountUniqueId.equals("")) { -// // if���̏����ɂ�accountURI�Ɋ܂܂��accountId�ƈ�����id�Ƃ̏ƍ������� -// accountCharacterList.add(character); -// } -// } -// return accountCharacterList; -// } - + @JSONHint(ignore = true) + public List getCharacters() { + List characters = new ArrayList<>(); + for (Character character : characterMap.values()) { + characters.add(character); + } + return characters; + } + + @JSONHint(ignore = true) public Character getCharacter(String characterId) { return characterMap.get(characterId); } @@ -155,7 +123,6 @@ public IDAddressedEntity createCharacter(String accountURI, String name, Position3D position, Angle angle, CharacterModel model) { String id = RandomStringGenerator.generateUniqueString(UNIQUE_ID_LENGTH, RandomStringGenerator.ALPHA_NUMERIC, characterMap.keySet()); -// String characterURI = (INSTANCE_URI + "/characters/" + id); Character character = new Character(accountURI, name, position, angle, model); characterMap.put(id, character); return new IDAddressedEntity(id, character);