refactor: unify comment styles
feat: add entity list class
This commit is contained in:
parent
67a7ab35f9
commit
3f7d393d5d
2
.gitignore
vendored
2
.gitignore
vendored
@ -44,6 +44,8 @@ gradle-app.setting
|
|||||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
|
|
||||||
|
.idea
|
||||||
|
|
||||||
# User-specific stuff
|
# User-specific stuff
|
||||||
.idea/**/workspace.xml
|
.idea/**/workspace.xml
|
||||||
.idea/**/tasks.xml
|
.idea/**/tasks.xml
|
||||||
|
@ -6,8 +6,7 @@ public class Tuple<X, Y> {
|
|||||||
public final X item1;
|
public final X item1;
|
||||||
public final Y item2;
|
public final Y item2;
|
||||||
|
|
||||||
/** Constructs a new {@link Tuple} based on the given objects.
|
/** Constructs a new {@link Tuple} based on the given objects. */
|
||||||
*/
|
|
||||||
public Tuple(X item1, Y item2) {
|
public Tuple(X item1, Y item2) {
|
||||||
this.item1 = item1;
|
this.item1 = item1;
|
||||||
this.item2 = item2;
|
this.item2 = item2;
|
||||||
|
@ -2,51 +2,43 @@ package uulm.teamname.marvelous.gamelibrary.entities;
|
|||||||
|
|
||||||
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
||||||
|
|
||||||
/** Represents a playable character inside a match.
|
/** Represents a playable character inside a match. */
|
||||||
*/
|
|
||||||
public class Character extends Entity {
|
public class Character extends Entity {
|
||||||
/** The name of the character.
|
/** The name of the character */
|
||||||
*/
|
|
||||||
public final String name;
|
public final String name;
|
||||||
|
|
||||||
/** The hp stat of the character.
|
/** The hp stat of the character */
|
||||||
*/
|
|
||||||
public final Stat hp;
|
public final Stat hp;
|
||||||
|
|
||||||
/** The mp stat of the character.
|
/** The mp stat of the character */
|
||||||
*/
|
|
||||||
public final Stat mp;
|
public final Stat mp;
|
||||||
|
|
||||||
/** The ap stat of the character.
|
/** The ap stat of the character */
|
||||||
*/
|
|
||||||
public final Stat ap;
|
public final Stat ap;
|
||||||
|
|
||||||
/** The ranged attack range of the character.
|
/** The ranged attack range of the character */
|
||||||
*/
|
|
||||||
public final int attackRange;
|
public final int attackRange;
|
||||||
|
|
||||||
/** The ranged attack damage of the character.
|
/** The ranged attack damage of the character */
|
||||||
*/
|
|
||||||
public final int rangedDamage;
|
public final int rangedDamage;
|
||||||
|
|
||||||
/** The melee attack damage of the character.
|
/** The melee attack damage of the character */
|
||||||
*/
|
|
||||||
public final int meleeDamage;
|
public final int meleeDamage;
|
||||||
|
|
||||||
/** The {@link Inventory} of the character.
|
/** The {@link Inventory} of the character */
|
||||||
*/
|
|
||||||
public final Inventory inventory = new Inventory();
|
public final Inventory inventory = new Inventory();
|
||||||
|
|
||||||
/** Constructs a new {@link Character} with an empty inventory.
|
/**
|
||||||
* @param id The {@link EntityID} of the character.
|
* Constructs a new {@link Character} with an empty inventory.
|
||||||
* @param position The position of the character.
|
* @param id The {@link EntityID} of the character
|
||||||
* @param name The name of the character.
|
* @param position The position of the character
|
||||||
* @param hp The maximum hp of the character.
|
* @param name The name of the character
|
||||||
* @param mp The maximum mp of the character.
|
* @param hp The maximum hp of the character
|
||||||
* @param ap The maximum ap of the character.
|
* @param mp The maximum mp of the character
|
||||||
* @param attackRange The ranged attack range of the character.
|
* @param ap The maximum ap of the character
|
||||||
* @param rangedDamage The ranged damage of the character.
|
* @param attackRange The ranged attack range of the character
|
||||||
* @param meleeDamage The melee damage of the character.
|
* @param rangedDamage The ranged damage of the character
|
||||||
|
* @param meleeDamage The melee damage of the character
|
||||||
*/
|
*/
|
||||||
public Character(EntityID id, IntVector2 position, String name, int hp, int mp, int ap, int attackRange, int rangedDamage, int meleeDamage) {
|
public Character(EntityID id, IntVector2 position, String name, int hp, int mp, int ap, int attackRange, int rangedDamage, int meleeDamage) {
|
||||||
super(id, position);
|
super(id, position);
|
||||||
@ -59,8 +51,9 @@ public class Character extends Entity {
|
|||||||
this.meleeDamage = meleeDamage;
|
this.meleeDamage = meleeDamage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Checks if the character is still alive.
|
/**
|
||||||
* @return Whether or not the characters hp is greater than 0.
|
* Checks if the character is still alive.
|
||||||
|
* @return Whether or not the characters hp is greater than 0
|
||||||
*/
|
*/
|
||||||
public boolean isAlive() {
|
public boolean isAlive() {
|
||||||
return hp.getValue() > 0;
|
return hp.getValue() > 0;
|
||||||
|
@ -2,24 +2,21 @@ package uulm.teamname.marvelous.gamelibrary.entities;
|
|||||||
|
|
||||||
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
||||||
|
|
||||||
/** Represents an abstract entity.
|
/** Represents an abstract entity. */
|
||||||
*/
|
|
||||||
public abstract class Entity {
|
public abstract class Entity {
|
||||||
/** Whether or not the entity is currently active in the game.
|
/** Whether or not the entity is currently active in the game */
|
||||||
*/
|
|
||||||
private boolean active = true;
|
private boolean active = true;
|
||||||
|
|
||||||
/** The position of the entity.
|
/** The position of the entity */
|
||||||
*/
|
|
||||||
private IntVector2 position;
|
private IntVector2 position;
|
||||||
|
|
||||||
/** The {@link EntityID} of the entity.
|
/** The {@link EntityID} of the entity */
|
||||||
*/
|
|
||||||
public final EntityID id;
|
public final EntityID id;
|
||||||
|
|
||||||
/** Constructs a new {@link Entity}.
|
/**
|
||||||
* @param id The {@link EntityID} of the entity.
|
* Constructs a new {@link Entity}.
|
||||||
* @param position The position of the entity.
|
* @param id The {@link EntityID} of the entity
|
||||||
|
* @param position The position of the entity
|
||||||
*/
|
*/
|
||||||
protected Entity(EntityID id, IntVector2 position) {
|
protected Entity(EntityID id, IntVector2 position) {
|
||||||
this.position = position;
|
this.position = position;
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
package uulm.teamname.marvelous.gamelibrary.entities;
|
package uulm.teamname.marvelous.gamelibrary.entities;
|
||||||
|
|
||||||
/** Represents a distinct identification for every {@link Entity} in a game.
|
/** Represents a distinct identification for every {@link Entity} in a game. */
|
||||||
*/
|
|
||||||
public class EntityID {
|
public class EntityID {
|
||||||
/** The index of the entity.
|
/** The index of the entity */
|
||||||
*/
|
|
||||||
public final int id;
|
public final int id;
|
||||||
|
|
||||||
/** The type of the entity.
|
/** The type of the entity */
|
||||||
*/
|
|
||||||
public final EntityType type;
|
public final EntityType type;
|
||||||
|
|
||||||
/** Constructs a new {@link Entity}-{@link EntityID} based on the given index and {@link EntityType}.
|
/**
|
||||||
* @param id The index of the entity.
|
* Constructs a new {@link Entity}-{@link EntityID} based on the given index and {@link EntityType}.
|
||||||
* @param type The type of the entity.
|
* @param id The index of the entity
|
||||||
|
* @param type The type of the entity
|
||||||
*/
|
*/
|
||||||
public EntityID(int id, EntityType type) {
|
public EntityID(int id, EntityType type) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Checks if the id has the same {@link EntityType} as the given one.
|
/**
|
||||||
* @param other The type to compare to.
|
* Checks if the id has the same {@link EntityType} as the given one.
|
||||||
* @return Whether or not the id has the same type.
|
* @param other The type to compare to
|
||||||
|
* @return Whether or not the id has the same type
|
||||||
*/
|
*/
|
||||||
public boolean isSameType(EntityType other) {
|
public boolean isSameType(EntityType other) {
|
||||||
return type == other;
|
return type == other;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Serializes the id for debugging.
|
/**
|
||||||
* @return A debug string containing all the necessary information about the id.
|
* Serializes the id for debugging.
|
||||||
|
* @return A debug string containing all the necessary information about the id
|
||||||
*/
|
*/
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "["+type.toString()+":"+id+"]";
|
return "["+type.toString()+":"+id+"]";
|
||||||
|
@ -0,0 +1,50 @@
|
|||||||
|
package uulm.teamname.marvelous.gamelibrary.entities;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
/** Represents a list of {@link Entity}s. */
|
||||||
|
public class EntityList {
|
||||||
|
/** The internal collection of {@link Entity}s */
|
||||||
|
private final HashSet<Entity> entities = new HashSet<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the list of entities.
|
||||||
|
*/
|
||||||
|
public void clear() {
|
||||||
|
entities.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds an entity to the list.
|
||||||
|
* @param entity The {@link Entity} to add
|
||||||
|
*/
|
||||||
|
public void addEntity(Entity entity) {
|
||||||
|
entities.add(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds multiple entities to the list.
|
||||||
|
* @param entities The entities to add
|
||||||
|
*/
|
||||||
|
public void addEntities(Entity... entities) {
|
||||||
|
this.entities.addAll(Arrays.asList(entities));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes an entity from the list.
|
||||||
|
* @param entity The {@link Entity} to remove
|
||||||
|
*/
|
||||||
|
public boolean removeEntity(Entity entity) {
|
||||||
|
return entities.remove(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Iterates over all entities inside the list.
|
||||||
|
* @return An iterator over every {@link Entity}
|
||||||
|
*/
|
||||||
|
public Iterator<Entity> getEntities() {
|
||||||
|
return entities.iterator();
|
||||||
|
}
|
||||||
|
}
|
@ -1,21 +1,15 @@
|
|||||||
package uulm.teamname.marvelous.gamelibrary.entities;
|
package uulm.teamname.marvelous.gamelibrary.entities;
|
||||||
|
|
||||||
/** Specifies the type of an {@link Entity}.
|
/** Specifies the type of an {@link Entity}. */
|
||||||
*/
|
|
||||||
public enum EntityType {
|
public enum EntityType {
|
||||||
/** Represents an NPC entity.
|
/** Represents an NPC entity */
|
||||||
*/
|
|
||||||
NPC,
|
NPC,
|
||||||
/** Represents the first Player.
|
/** Represents the first Player */
|
||||||
*/
|
|
||||||
P1,
|
P1,
|
||||||
/** Represents the second Player.
|
/** Represents the second Player */
|
||||||
*/
|
|
||||||
P2,
|
P2,
|
||||||
/** Represents a Rock entity.
|
/** Represents a Rock entity */
|
||||||
*/
|
|
||||||
Rocks,
|
Rocks,
|
||||||
/** Represents an InfinityStone entity.
|
/** Represents an InfinityStone entity */
|
||||||
*/
|
|
||||||
InfinityStones
|
InfinityStones
|
||||||
}
|
}
|
||||||
|
@ -2,17 +2,16 @@ package uulm.teamname.marvelous.gamelibrary.entities;
|
|||||||
|
|
||||||
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
||||||
|
|
||||||
/** Represents an infinity stone {@link Entity}. Can only exist on the map.
|
/** Represents an infinity stone {@link Entity}. Can only exist on the map. */
|
||||||
*/
|
|
||||||
public class InfinityStone extends Entity {
|
public class InfinityStone extends Entity {
|
||||||
/** The {@link StoneType} of the infinity stone.
|
/** The {@link StoneType} of the infinity stone */
|
||||||
*/
|
|
||||||
public final StoneType type;
|
public final StoneType type;
|
||||||
|
|
||||||
/** Constructs a new {@link InfinityStone}.
|
/**
|
||||||
* @param id The {@link EntityID} of the stone.
|
* Constructs a new {@link InfinityStone}.
|
||||||
* @param position The position of the stone.
|
* @param id The {@link EntityID} of the stone
|
||||||
* @param type The {@link StoneType} of the stone.
|
* @param position The position of the stone
|
||||||
|
* @param type The {@link StoneType} of the stone
|
||||||
*/
|
*/
|
||||||
public InfinityStone(EntityID id, IntVector2 position, StoneType type) {
|
public InfinityStone(EntityID id, IntVector2 position, StoneType type) {
|
||||||
super(id, position);
|
super(id, position);
|
||||||
|
@ -4,19 +4,17 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
/** Represents an inventory of 6 slots of {@link StoneType}s that can be manipulated.
|
/** Represents an inventory of 6 slots of {@link StoneType}s that can be manipulated. */
|
||||||
*/
|
|
||||||
public class Inventory implements Iterable<StoneType> {
|
public class Inventory implements Iterable<StoneType> {
|
||||||
/** The size of the inventory.
|
/** The size of the inventory */
|
||||||
*/
|
|
||||||
private final int size = 6;
|
private final int size = 6;
|
||||||
|
|
||||||
/** The content of the inventory.
|
/** The content of the inventory */
|
||||||
*/
|
|
||||||
private final HashSet<StoneType> content = new HashSet<>(size);
|
private final HashSet<StoneType> content = new HashSet<>(size);
|
||||||
|
|
||||||
/** Constructs a new {@link Inventory}.
|
/**
|
||||||
* @param content The starting content of the inventory.
|
* Constructs a new {@link Inventory}.
|
||||||
|
* @param content The starting content of the inventory
|
||||||
*/
|
*/
|
||||||
public Inventory(ArrayList<StoneType> content) {
|
public Inventory(ArrayList<StoneType> content) {
|
||||||
if(content.size() > size) {
|
if(content.size() > size) {
|
||||||
@ -31,27 +29,27 @@ public class Inventory implements Iterable<StoneType> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Constructs a new empty {@link Inventory}.
|
/** Constructs a new empty {@link Inventory}. */
|
||||||
*/
|
|
||||||
public Inventory() {
|
public Inventory() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the number of free slots the inventory has.
|
/** Returns the number of free slots the inventory has. */
|
||||||
*/
|
|
||||||
public int getFreeSlots() {
|
public int getFreeSlots() {
|
||||||
return size - content.size();
|
return size - content.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Checks if the inventory contains the given stone.
|
/**
|
||||||
* @param stone The {@link StoneType} to check for.
|
* Checks if the inventory contains the given stone.
|
||||||
|
* @param stone The {@link StoneType} to check for
|
||||||
*/
|
*/
|
||||||
public boolean hasStone(StoneType stone) {
|
public boolean hasStone(StoneType stone) {
|
||||||
return content.contains(stone);
|
return content.contains(stone);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Adds a stone to the inventory.
|
/**
|
||||||
* @param stone The {@link StoneType} to add.
|
* Adds a stone to the inventory.
|
||||||
|
* @param stone The {@link StoneType} to add
|
||||||
*/
|
*/
|
||||||
public void addStone(StoneType stone) {
|
public void addStone(StoneType stone) {
|
||||||
if(content.contains(stone)) {
|
if(content.contains(stone)) {
|
||||||
@ -64,8 +62,9 @@ public class Inventory implements Iterable<StoneType> {
|
|||||||
content.add(stone);
|
content.add(stone);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Removes a stone from the inventory.
|
/**
|
||||||
* @param stone The {@link StoneType} to remove.
|
* Removes a stone from the inventory.
|
||||||
|
* @param stone The {@link StoneType} to remove
|
||||||
*/
|
*/
|
||||||
public void removeStone(StoneType stone) {
|
public void removeStone(StoneType stone) {
|
||||||
if(!content.contains(stone)) {
|
if(!content.contains(stone)) {
|
||||||
@ -75,8 +74,7 @@ public class Inventory implements Iterable<StoneType> {
|
|||||||
content.remove(stone);
|
content.remove(stone);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Iterates over the inventory.
|
/** Iterates over the inventory. */
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Iterator<StoneType> iterator() {
|
public Iterator<StoneType> iterator() {
|
||||||
return content.iterator();
|
return content.iterator();
|
||||||
|
@ -4,26 +4,26 @@ import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/** Represents an NPC inside the game.
|
/** Represents an NPC inside the game. */
|
||||||
*/
|
|
||||||
public class NPC extends Entity {
|
public class NPC extends Entity {
|
||||||
/** The {@link Inventory} of the NPC.
|
/** The {@link Inventory} of the NPC */
|
||||||
*/
|
|
||||||
public final Inventory inventory;
|
public final Inventory inventory;
|
||||||
|
|
||||||
/** Constructs a new {@link NPC}.
|
/**
|
||||||
* @param id The {@link EntityID} of the NPC.
|
* Constructs a new {@link NPC}.
|
||||||
* @param position The position of the NPC.
|
* @param id The {@link EntityID} of the NPC
|
||||||
* @param inventory The starting inventory the NPC should have.
|
* @param position The position of the NPC
|
||||||
|
* @param inventory The starting inventory the NPC should have
|
||||||
*/
|
*/
|
||||||
public NPC(EntityID id, IntVector2 position, ArrayList<StoneType> inventory) {
|
public NPC(EntityID id, IntVector2 position, ArrayList<StoneType> inventory) {
|
||||||
super(id, position);
|
super(id, position);
|
||||||
this.inventory = new Inventory(inventory);
|
this.inventory = new Inventory(inventory);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Constructs a new {@link NPC} with an empty inventory.
|
/**
|
||||||
* @param id The {@link EntityID} of the NPC.
|
* Constructs a new {@link NPC} with an empty inventory.
|
||||||
* @param position The position of the NPC.
|
* @param id The {@link EntityID} of the NPC
|
||||||
|
* @param position The position of the NPC
|
||||||
*/
|
*/
|
||||||
public NPC(EntityID id, IntVector2 position) {
|
public NPC(EntityID id, IntVector2 position) {
|
||||||
super(id, position);
|
super(id, position);
|
||||||
|
@ -1,15 +1,8 @@
|
|||||||
package uulm.teamname.marvelous.gamelibrary.entities;
|
package uulm.teamname.marvelous.gamelibrary.entities;
|
||||||
|
|
||||||
/** Specifies the type of an {@link NPC}.
|
/** Specifies the type of an {@link NPC}. */
|
||||||
*/
|
|
||||||
public enum NPCType {
|
public enum NPCType {
|
||||||
/** Represents the Goose.
|
|
||||||
*/
|
|
||||||
Goose,
|
Goose,
|
||||||
/** Represents Stan Lee.
|
|
||||||
*/
|
|
||||||
Stan,
|
Stan,
|
||||||
/** Represents Thanos.
|
|
||||||
*/
|
|
||||||
Thanos
|
Thanos
|
||||||
}
|
}
|
||||||
|
@ -2,21 +2,19 @@ package uulm.teamname.marvelous.gamelibrary.entities;
|
|||||||
|
|
||||||
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
||||||
|
|
||||||
/** Represents a rock entity on the map.
|
/** Represents a rock entity on the map. */
|
||||||
*/
|
|
||||||
public class Rock extends Entity {
|
public class Rock extends Entity {
|
||||||
/** The maximum hp of the rock.
|
/** The maximum hp of the rock */
|
||||||
*/
|
|
||||||
public final int maxHP;
|
public final int maxHP;
|
||||||
|
|
||||||
/** The current hp of the rock.
|
/** The current hp of the rock */
|
||||||
*/
|
|
||||||
private int hp;
|
private int hp;
|
||||||
|
|
||||||
/** Constructs a new {@link Rock}.
|
/**
|
||||||
* @param id The {@link EntityID} of the rock.
|
* Constructs a new {@link Rock}.
|
||||||
* @param position The position of the rock.
|
* @param id The {@link EntityID} of the rock
|
||||||
* @param hp The hp of the rock.
|
* @param position The position of the rock
|
||||||
|
* @param hp The hp of the rock
|
||||||
*/
|
*/
|
||||||
public Rock(EntityID id, IntVector2 position, int hp) {
|
public Rock(EntityID id, IntVector2 position, int hp) {
|
||||||
super(id, position);
|
super(id, position);
|
||||||
|
@ -1,23 +1,20 @@
|
|||||||
package uulm.teamname.marvelous.gamelibrary.entities;
|
package uulm.teamname.marvelous.gamelibrary.entities;
|
||||||
|
|
||||||
/** Represents a stat property of a {@link Character}.
|
/** Represents a stat property of a {@link Character}. */
|
||||||
*/
|
|
||||||
public class Stat {
|
public class Stat {
|
||||||
/** The {@link StatType} of the stat.
|
/** The {@link StatType} of the stat */
|
||||||
*/
|
|
||||||
public final StatType type;
|
public final StatType type;
|
||||||
|
|
||||||
/** The maximum value of the stat.
|
/** The maximum value of the stat */
|
||||||
*/
|
|
||||||
public final int max;
|
public final int max;
|
||||||
|
|
||||||
/** The current value of the stat.
|
/** The current value of the stat */
|
||||||
*/
|
|
||||||
private int value;
|
private int value;
|
||||||
|
|
||||||
/** Constructs a new {@link Stat} with the initial value set to the maximum value.
|
/**
|
||||||
* @param type The {@link StatType} of the stat.
|
* Constructs a new {@link Stat} with the initial value set to the maximum value.
|
||||||
* @param max The maximum value of the stat.
|
* @param type The {@link StatType} of the stat
|
||||||
|
* @param max The maximum value of the stat
|
||||||
*/
|
*/
|
||||||
public Stat(StatType type, int max) {
|
public Stat(StatType type, int max) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
package uulm.teamname.marvelous.gamelibrary.entities;
|
package uulm.teamname.marvelous.gamelibrary.entities;
|
||||||
|
|
||||||
/** Specifies the type of a {@link Stat}.
|
/** Specifies the type of a {@link Stat}. */
|
||||||
*/
|
|
||||||
public enum StatType {
|
public enum StatType {
|
||||||
/** Represents the life points of a character.
|
/** Represents the life points of a character */
|
||||||
*/
|
|
||||||
HP,
|
HP,
|
||||||
/** Represents the mana points of a character.
|
/** Represents the mana points of a character */
|
||||||
*/
|
|
||||||
MP,
|
MP,
|
||||||
/** Represents thr action points of a character.
|
/** Represents thr action points of a character */
|
||||||
*/
|
|
||||||
AP
|
AP
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package uulm.teamname.marvelous.gamelibrary.entities;
|
package uulm.teamname.marvelous.gamelibrary.entities;
|
||||||
|
|
||||||
/** Specifies the type of an {@link InfinityStone}.
|
/** Specifies the type of an {@link InfinityStone}. */
|
||||||
*/
|
|
||||||
public enum StoneType {
|
public enum StoneType {
|
||||||
SpaceStone,
|
SpaceStone,
|
||||||
MindStone,
|
MindStone,
|
||||||
|
@ -1,20 +1,21 @@
|
|||||||
package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
||||||
|
|
||||||
/** Contains checksum calculations.
|
/** Contains checksum calculations. */
|
||||||
*/
|
|
||||||
class ChecksumCalculator {
|
class ChecksumCalculator {
|
||||||
/** Compares a checksum to the checksum of a {@link GameState}.
|
/**
|
||||||
* @param state The state to check.
|
* Compares a checksum to the checksum of a {@link GameState}.
|
||||||
* @param input the checksum to compare to.
|
* @param state The state to check
|
||||||
* @return Whether or not the checksum matches the state's checksum.
|
* @param input the checksum to compare to
|
||||||
|
* @return Whether or not the checksum matches the state's checksum
|
||||||
*/
|
*/
|
||||||
public static boolean checkChecksum(GameState state, long input) {
|
public static boolean checkChecksum(GameState state, long input) {
|
||||||
return calculateChecksum(state) == input;
|
return calculateChecksum(state) == input;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Calculates the corresponding checksum to a {@link GameState}.
|
/**
|
||||||
* @param state The state to check.
|
* Calculates the corresponding checksum to a {@link GameState}.
|
||||||
* @return The checksum.
|
* @param state The state to check
|
||||||
|
* @return The checksum
|
||||||
*/
|
*/
|
||||||
public static long calculateChecksum(GameState state) {
|
public static long calculateChecksum(GameState state) {
|
||||||
//TODO: implement ChecksumCalculator.calculateChecksum
|
//TODO: implement ChecksumCalculator.calculateChecksum
|
||||||
|
@ -2,8 +2,7 @@ package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
|||||||
|
|
||||||
import java.util.Observable;
|
import java.util.Observable;
|
||||||
|
|
||||||
/** Represents an event emitter for game events fired by a game instance.
|
/** Represents an event emitter for game events fired by a game instance. */
|
||||||
*/
|
|
||||||
class EventEmitter extends Observable {
|
class EventEmitter extends Observable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,51 +6,48 @@ import uulm.teamname.marvelous.gamelibrary.requests.Request;
|
|||||||
|
|
||||||
import java.util.Observer;
|
import java.util.Observer;
|
||||||
|
|
||||||
/** Represents a game instance.
|
/** Represents a game instance. */
|
||||||
*/
|
|
||||||
public class GameInstance {
|
public class GameInstance {
|
||||||
/** The private {@link GameState} of the instance.
|
/** The private {@link GameState} of the instance */
|
||||||
*/
|
|
||||||
private final GameState _state;
|
private final GameState _state;
|
||||||
|
|
||||||
/** The public view for the underlying {@link GameState} of the instance.
|
/** The public view for the underlying {@link GameState} of the instance */
|
||||||
*/
|
|
||||||
public final GameStateView state;
|
public final GameStateView state;
|
||||||
|
|
||||||
/** The {@link GameStateManager} managing the {@link GameState} of the instance.
|
/** The {@link GameStateManager} managing the {@link GameState} of the instance */
|
||||||
*/
|
|
||||||
private final GameStateManager manager;
|
private final GameStateManager manager;
|
||||||
|
|
||||||
/** The {@link EventEmitter} for {@link Event}s resulting from {@link Request}s.
|
/** The {@link EventEmitter} for {@link Event}s resulting from {@link Request}s */
|
||||||
*/
|
|
||||||
private final EventEmitter emitter = new EventEmitter();
|
private final EventEmitter emitter = new EventEmitter();
|
||||||
|
|
||||||
/** Constructs a new {@link GameInstance}.
|
/** Constructs a new {@link GameInstance}. */
|
||||||
*/
|
|
||||||
public GameInstance(IntVector2 mapSize) {
|
public GameInstance(IntVector2 mapSize) {
|
||||||
_state = new GameState(mapSize);
|
_state = new GameState(mapSize);
|
||||||
this.state = new GameStateView(_state);
|
this.state = new GameStateView(_state);
|
||||||
manager = new GameStateManager(_state);
|
manager = new GameStateManager(_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Checks a checksum with the current one.
|
/**
|
||||||
* @param input The checksum to compare to.
|
* Checks a checksum with the current one.
|
||||||
* @return Whether or not the checksum matches.
|
* @param input The checksum to compare to
|
||||||
|
* @return Whether or not the checksum matches
|
||||||
*/
|
*/
|
||||||
public boolean checkChecksum(long input) {
|
public boolean checkChecksum(long input) {
|
||||||
return ChecksumCalculator.checkChecksum(_state, input);
|
return ChecksumCalculator.checkChecksum(_state, input);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Calculates the current checksum of the game state.
|
/**
|
||||||
* @return The calculated checksum.
|
* Calculates the current checksum of the game state.
|
||||||
|
* @return The calculated checksum
|
||||||
*/
|
*/
|
||||||
public long calculateChecksum() {
|
public long calculateChecksum() {
|
||||||
return ChecksumCalculator.calculateChecksum(_state);
|
return ChecksumCalculator.calculateChecksum(_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Checks an array of {@link Request}s for validity and automatically applies them if valid.
|
/**
|
||||||
* @param requests The requests to check.
|
* Checks an array of {@link Request}s for validity and automatically applies them if valid.
|
||||||
* @return Whether or not the given set of requests was valid.
|
* @param requests The requests to check
|
||||||
|
* @return Whether or not the given set of requests was valid
|
||||||
*/
|
*/
|
||||||
public boolean checkRequestsAndApply(Request... requests) {
|
public boolean checkRequestsAndApply(Request... requests) {
|
||||||
if(manager.processRequests(requests, true)) {
|
if(manager.processRequests(requests, true)) {
|
||||||
@ -60,30 +57,34 @@ public class GameInstance {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Checks an array of {@link Request}s for validity without applying it.
|
/**
|
||||||
* @param requests The requests to check.
|
* Checks an array of {@link Request}s for validity without applying it.
|
||||||
* @return Whether or not the given set of requests is valid.
|
* @param requests The requests to check
|
||||||
|
* @return Whether or not the given set of requests is valid
|
||||||
*/
|
*/
|
||||||
public boolean checkRequestsSilent(Request... requests) {
|
public boolean checkRequestsSilent(Request... requests) {
|
||||||
return manager.processRequests(requests, false);
|
return manager.processRequests(requests, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Applies an array of {@link Event}s to the game state.
|
/**
|
||||||
|
* Applies an array of {@link Event}s to the game state.
|
||||||
* @param events The events to apply.
|
* @param events The events to apply.
|
||||||
*/
|
*/
|
||||||
public void applyEvents(Event... events) {
|
public void applyEvents(Event... events) {
|
||||||
manager.applyEvents(events);
|
manager.applyEvents(events);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Adds an {@link Observer} for events.
|
/**
|
||||||
* @param observer The observer to add.
|
* Adds an {@link Observer} for events.
|
||||||
|
* @param observer The observer to add
|
||||||
*/
|
*/
|
||||||
public void addObserver(Observer observer) {
|
public void addObserver(Observer observer) {
|
||||||
emitter.addObserver(observer);
|
emitter.addObserver(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Emits an array of {@link Event}s.
|
/**
|
||||||
* @param events The events to emit.
|
* Emits an array of {@link Event}s.
|
||||||
|
* @param events The events to emit
|
||||||
*/
|
*/
|
||||||
private void emit(Event... events) {
|
private void emit(Event... events) {
|
||||||
emitter.notifyObservers(events);
|
emitter.notifyObservers(events);
|
||||||
|
@ -7,11 +7,11 @@ import uulm.teamname.marvelous.gamelibrary.requests.Request;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
/** Contains game logic handling.
|
/** Contains game logic handling. */
|
||||||
*/
|
|
||||||
class GameLogic {
|
class GameLogic {
|
||||||
/** Produces resulting {@link Event}s from a given {@link Request} independently of any {@link GameState}.
|
/**
|
||||||
* @return The list of resulting events.
|
* Produces resulting {@link Event}s from a given {@link Request} independently of any {@link GameState}.
|
||||||
|
* @return The list of resulting events
|
||||||
*/
|
*/
|
||||||
public static ArrayList<Event> executeRequest(Request request) {
|
public static ArrayList<Event> executeRequest(Request request) {
|
||||||
ArrayList<Event> result = new ArrayList<Event>();
|
ArrayList<Event> result = new ArrayList<Event>();
|
||||||
@ -30,9 +30,10 @@ class GameLogic {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Checks a {@link Request} for validity for a {@link GameState}.
|
/**
|
||||||
* @param state The game state to check on.
|
* Checks a {@link Request} for validity for a {@link GameState}.
|
||||||
* @param request The request to validate.
|
* @param state The game state to check on
|
||||||
|
* @param request The request to validate
|
||||||
* @return Whether or not the request is valid
|
* @return Whether or not the request is valid
|
||||||
*/
|
*/
|
||||||
public static boolean checkRequest(GameState state, Request request) {
|
public static boolean checkRequest(GameState state, Request request) {
|
||||||
@ -40,17 +41,19 @@ class GameLogic {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Applies an {@link Event} to a {@link GameState}.
|
/**
|
||||||
* @param state The game state to apply to.
|
* Applies an {@link Event} to a {@link GameState}.
|
||||||
* @param event The event to apply.
|
* @param state The game state to apply to
|
||||||
|
* @param event The event to apply
|
||||||
*/
|
*/
|
||||||
public static void applyEvent(GameState state, Event event) {
|
public static void applyEvent(GameState state, Event event) {
|
||||||
//TODO: implement GameLogic.applyEvent
|
//TODO: implement GameLogic.applyEvent
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Checks a {@link GameState} for the current overtime win condition.
|
/**
|
||||||
* @param state The game state to check.
|
* Checks a {@link GameState} for the current overtime win condition.
|
||||||
* @return The {@link ParticipantType} that is currently winning the game according to overtime ruling.
|
* @param state The game state to check
|
||||||
|
* @return The {@link ParticipantType} that is currently winning the game according to overtime ruling
|
||||||
*/
|
*/
|
||||||
public static ParticipantType checkWinConditions(GameState state) {
|
public static ParticipantType checkWinConditions(GameState state) {
|
||||||
//TODO: GameLogic.checkWinConditions is kind of ugly
|
//TODO: GameLogic.checkWinConditions is kind of ugly
|
||||||
|
@ -3,60 +3,53 @@ package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
|||||||
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
||||||
import uulm.teamname.marvelous.gamelibrary.entities.Entity;
|
import uulm.teamname.marvelous.gamelibrary.entities.Entity;
|
||||||
import uulm.teamname.marvelous.gamelibrary.entities.EntityID;
|
import uulm.teamname.marvelous.gamelibrary.entities.EntityID;
|
||||||
|
import uulm.teamname.marvelous.gamelibrary.entities.EntityList;
|
||||||
import uulm.teamname.marvelous.gamelibrary.entities.StoneType;
|
import uulm.teamname.marvelous.gamelibrary.entities.StoneType;
|
||||||
import uulm.teamname.marvelous.gamelibrary.Tuple;
|
import uulm.teamname.marvelous.gamelibrary.Tuple;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
/** Represents the state of a game instance.
|
/** Represents the state of a game instance. */
|
||||||
*/
|
|
||||||
class GameState {
|
class GameState {
|
||||||
/** The size of the map.
|
/** The size of the map */
|
||||||
*/
|
|
||||||
public final IntVector2 mapSize;
|
public final IntVector2 mapSize;
|
||||||
|
|
||||||
/** The list of {@link Entity}'s inside the game.
|
/** The list of {@link Entity}s inside the game */
|
||||||
*/
|
public final EntityList entities = new EntityList();
|
||||||
public ArrayList<Entity> entities;
|
|
||||||
|
|
||||||
/** The total amount of full turn cycles that occurred.
|
/** The total amount of full turn cycles that occurred */
|
||||||
*/
|
|
||||||
public int roundNumber = 0;
|
public int roundNumber = 0;
|
||||||
|
|
||||||
/** The turn order of every character.
|
/** The turn order of every character */
|
||||||
*/
|
|
||||||
public ArrayList<EntityID> turnOrder;
|
public ArrayList<EntityID> turnOrder;
|
||||||
|
|
||||||
/** The total amount of turns that occurred.
|
/** The total amount of turns that occurred */
|
||||||
*/
|
|
||||||
public int turnNumber = 0;
|
public int turnNumber = 0;
|
||||||
|
|
||||||
/** The {@link EntityID} of the active character.
|
/** The {@link EntityID} of the active character */
|
||||||
*/
|
|
||||||
public EntityID activeCharacter;
|
public EntityID activeCharacter;
|
||||||
|
|
||||||
/** Whether or not the game was won.
|
/** Whether or not the game was won */
|
||||||
*/
|
|
||||||
public boolean won = false;
|
public boolean won = false;
|
||||||
|
|
||||||
/** The global cooldown of every infinity stone.
|
/** The global cooldown of every infinity stone */
|
||||||
*/
|
public final HashMap<StoneType, Float> stoneCooldown = new HashMap<>();
|
||||||
public HashMap<StoneType, Float> stoneCooldown;
|
|
||||||
|
|
||||||
/** The store of the {@link WinCondition} data for every win condition for each player.
|
/** The store of the {@link WinCondition} data for every win condition for each player */
|
||||||
*/
|
public final HashMap<Tuple<ParticipantType, WinCondition>, Integer> winConditions = new HashMap<>();
|
||||||
public HashMap<Tuple<ParticipantType, WinCondition>, Integer> winConditions;
|
|
||||||
|
|
||||||
/** Constructs a new {@link GameState}.
|
/**
|
||||||
* @param mapSize The size of the map.
|
* Constructs a new {@link GameState}.
|
||||||
|
* @param mapSize The size of the map
|
||||||
*/
|
*/
|
||||||
public GameState(IntVector2 mapSize) {
|
public GameState(IntVector2 mapSize) {
|
||||||
this.mapSize = mapSize;
|
this.mapSize = mapSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Clones the state into a new {@link GameState} object.
|
/**
|
||||||
* @return The cloned game state.
|
* Clones the state into a new {@link GameState} object.
|
||||||
|
* @return The cloned game state
|
||||||
*/
|
*/
|
||||||
public GameState snapshot() {
|
public GameState snapshot() {
|
||||||
//TODO: implement GameState.snapshot
|
//TODO: implement GameState.snapshot
|
||||||
|
@ -6,27 +6,26 @@ import uulm.teamname.marvelous.gamelibrary.requests.Request;
|
|||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/** Represents manager for a game state.
|
/** Represents manager for a game state. */
|
||||||
*/
|
|
||||||
class GameStateManager {
|
class GameStateManager {
|
||||||
/** The managed {@link GameState}.
|
/** The managed {@link GameState} */
|
||||||
*/
|
|
||||||
private final GameState state;
|
private final GameState state;
|
||||||
|
|
||||||
/** The queue of {@link Event}s to be applied during {@link Request} processing.
|
/** The queue of {@link Event}s to be applied during {@link Request} processing */
|
||||||
*/
|
|
||||||
private final ArrayDeque<Event> queue = new ArrayDeque<Event>();
|
private final ArrayDeque<Event> queue = new ArrayDeque<Event>();
|
||||||
|
|
||||||
/** Constructs a new {@link GameStateManager}.
|
/**
|
||||||
* @param state A reference to the state to be managed.
|
* Constructs a new {@link GameStateManager}.
|
||||||
|
* @param state A reference to the state to be managed
|
||||||
*/
|
*/
|
||||||
public GameStateManager(GameState state) {
|
public GameStateManager(GameState state) {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Checks a list of {@link Request}s for validity and optionally produces resulting {@link Event}s.
|
/**
|
||||||
* @param requests The requests to check.
|
* Checks a list of {@link Request}s for validity and optionally produces resulting {@link Event}s.
|
||||||
* @param apply True if resulting events should be stored for later application.
|
* @param requests The requests to check
|
||||||
|
* @param apply True if resulting events should be stored for later application
|
||||||
*/
|
*/
|
||||||
public boolean processRequests(Request[] requests, boolean apply) {
|
public boolean processRequests(Request[] requests, boolean apply) {
|
||||||
GameState snapshot = state.snapshot();
|
GameState snapshot = state.snapshot();
|
||||||
@ -46,8 +45,9 @@ class GameStateManager {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Applies an array of {@link Event}s to the game state.
|
/**
|
||||||
* @param events The events to apply.
|
* Applies an array of {@link Event}s to the game state.
|
||||||
|
* @param events The events to apply
|
||||||
*/
|
*/
|
||||||
public void applyEvents(Event[] events) {
|
public void applyEvents(Event[] events) {
|
||||||
for(Event event: events) {
|
for(Event event: events) {
|
||||||
@ -55,8 +55,9 @@ class GameStateManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Applies the result of the last processRequests call.
|
/**
|
||||||
* @return A list of applied events.
|
* Applies the result of the last processRequests call.
|
||||||
|
* @return A list of applied events
|
||||||
*/
|
*/
|
||||||
public Event[] apply() {
|
public Event[] apply() {
|
||||||
Event[] toReturn = new Event[queue.size()];
|
Event[] toReturn = new Event[queue.size()];
|
||||||
|
@ -3,16 +3,16 @@ package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
|||||||
import uulm.teamname.marvelous.gamelibrary.entities.Entity;
|
import uulm.teamname.marvelous.gamelibrary.entities.Entity;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
/** Represents a game state view containing getters for all the properties of a {@link GameState}.
|
/** Represents a game state view containing getters for all the properties of a {@link GameState}. */
|
||||||
*/
|
|
||||||
public class GameStateView {
|
public class GameStateView {
|
||||||
/** The managed {@link GameState}.
|
/** The managed {@link GameState} */
|
||||||
*/
|
|
||||||
private final GameState state;
|
private final GameState state;
|
||||||
|
|
||||||
/** Constructs a new {@link GameStateView}.
|
/**
|
||||||
* @param state A reference to the state to be viewable.
|
* Constructs a new {@link GameStateView}.
|
||||||
|
* @param state A reference to the state to be viewable
|
||||||
*/
|
*/
|
||||||
public GameStateView(GameState state) {
|
public GameStateView(GameState state) {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
@ -20,7 +20,7 @@ public class GameStateView {
|
|||||||
|
|
||||||
//TODO: add immutable getters for all state properties
|
//TODO: add immutable getters for all state properties
|
||||||
|
|
||||||
public ArrayList<Entity> getEntities() {
|
public Iterator<Entity> getEntities() {
|
||||||
return new ArrayList<>(state.entities);
|
return state.entities.getEntities();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
||||||
|
|
||||||
/** Specifies a participant type.
|
/** Specifies a participant type. */
|
||||||
*/
|
|
||||||
public enum ParticipantType {
|
public enum ParticipantType {
|
||||||
None,
|
None,
|
||||||
Player1,
|
Player1,
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
||||||
|
|
||||||
/** Specifies a win condition. The order is important here.
|
/** Specifies a win condition. The order is important here. */
|
||||||
*/
|
|
||||||
enum WinCondition {
|
enum WinCondition {
|
||||||
/** The maximum amount of total infinity stones the player had at a time.
|
/** The maximum amount of total infinity stones the player had at a time */
|
||||||
*/
|
|
||||||
MaxStones,
|
MaxStones,
|
||||||
/** The total amount of enemy characters the player knocked out.
|
/** The total amount of enemy characters the player knocked out */
|
||||||
*/
|
|
||||||
TotalKnockouts,
|
TotalKnockouts,
|
||||||
/** The total amount of damage the player did to enemy characters.
|
/** The total amount of damage the player did to enemy characters */
|
||||||
*/
|
|
||||||
TotalDamage
|
TotalDamage
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,7 @@ import uulm.teamname.marvelous.gamelibrary.json.ingame.MessageStructure;
|
|||||||
public class JSON {
|
public class JSON {
|
||||||
/** Deserializes an incoming network message into a {@link MessageStructure}.
|
/** Deserializes an incoming network message into a {@link MessageStructure}.
|
||||||
* @param input The JSON to deserialize.
|
* @param input The JSON to deserialize.
|
||||||
* @return The parsed message.
|
* @return The parsed message. */
|
||||||
*/
|
|
||||||
public static MessageStructure[] parse(String input) throws ExecutionControl.NotImplementedException {
|
public static MessageStructure[] parse(String input) throws ExecutionControl.NotImplementedException {
|
||||||
//TODO: implement JSON.parse
|
//TODO: implement JSON.parse
|
||||||
throw new ExecutionControl.NotImplementedException("JSON.parse is not implemented");
|
throw new ExecutionControl.NotImplementedException("JSON.parse is not implemented");
|
||||||
@ -17,8 +16,7 @@ public class JSON {
|
|||||||
|
|
||||||
/** Serializes a {@link MessageStructure} into a JSON string.
|
/** Serializes a {@link MessageStructure} into a JSON string.
|
||||||
* @param input The message to serialize.
|
* @param input The message to serialize.
|
||||||
* @return The message as JSON.
|
* @return The message as JSON. */
|
||||||
*/
|
|
||||||
public static String stringify(MessageStructure input) throws ExecutionControl.NotImplementedException {
|
public static String stringify(MessageStructure input) throws ExecutionControl.NotImplementedException {
|
||||||
//TODO: implement JSON.stringify
|
//TODO: implement JSON.stringify
|
||||||
throw new ExecutionControl.NotImplementedException("JSON.stringify is not implemented");
|
throw new ExecutionControl.NotImplementedException("JSON.stringify is not implemented");
|
||||||
|
Loading…
Reference in New Issue
Block a user