diff --git a/src/commands/dew/CommandDew.java b/src/commands/dew/CommandDew.java index 55c5a36..28bb585 100644 --- a/src/commands/dew/CommandDew.java +++ b/src/commands/dew/CommandDew.java @@ -29,6 +29,6 @@ public class CommandDew extends Command { super(level, rating); framework.addCommand("luatest", new CommandDewLuaTest(KittyRole.Dev, KittyRating.Safe)); + framework.addCommand("realm", new CommandDewRealm(KittyRole.Dev, KittyRating.Safe)); } - } diff --git a/src/commands/dew/CommandDewInput.java b/src/commands/dew/CommandDewInput.java new file mode 100644 index 0000000..6f63df8 --- /dev/null +++ b/src/commands/dew/CommandDewInput.java @@ -0,0 +1,25 @@ +package commands.dew; + +import core.SubCommand; +import core.SubCommandFormattable; +import dataStructures.KittyChannel; +import dataStructures.KittyGuild; +import dataStructures.KittyRating; +import dataStructures.KittyRole; +import dataStructures.KittyUser; +import dataStructures.UserInput; + +public class CommandDewInput extends SubCommand +{ + public CommandDewInput(KittyRole roleLevel, KittyRating contentRating) { + super(roleLevel, contentRating); + // TODO Auto-generated constructor stub + } + + @Override + public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/commands/dew/CommandDewLuaTest.java b/src/commands/dew/CommandDewLuaTest.java index 5877cf8..e3133e9 100644 --- a/src/commands/dew/CommandDewLuaTest.java +++ b/src/commands/dew/CommandDewLuaTest.java @@ -1,5 +1,7 @@ package commands.dew; +import java.util.UUID; + import commands.dew.core.data.*; import commands.dew.core.impl.DewLuaCore; import core.SubCommand; @@ -36,8 +38,8 @@ public class CommandDewLuaTest extends SubCommand try { out += "**Testing writing...\n**"; - DewMap m = new DewMap(); - m.mapHeight = 25; + DewRealm m = new DewRealm(); + m.id = UUID.randomUUID().toString(); String out1 = DewLuaCore.toLua(m); out += asCodeBlock(out1); @@ -46,13 +48,13 @@ public class CommandDewLuaTest extends SubCommand out += "**Testing Reading...**\n"; - DewMap map = new DewMap(); + DewRealm map = new DewRealm(); DewLuaCore.fromLua(map, out1); - out += "Height from 1st write: " + map.mapHeight + "\n"; + out += "ID from 1st write: " + asCodeLine(map.id) + "\n"; DewMovementInfo move = new DewMovementInfo(); DewLuaCore.fromLua(move, out2); - out += move + "\n"; + out += "Qualified type test: " + asCodeLine(move.toString()) + "\n"; } catch (Exception e) { diff --git a/src/commands/dew/CommandDewRealm.java b/src/commands/dew/CommandDewRealm.java new file mode 100644 index 0000000..d28e78f --- /dev/null +++ b/src/commands/dew/CommandDewRealm.java @@ -0,0 +1,60 @@ +package commands.dew; + +import commands.dew.core.data.DewMapTile; +import commands.dew.core.data.DewRealm; +import core.SubCommand; +import core.SubCommandFormattable; +import dataStructures.KittyChannel; +import dataStructures.KittyGuild; +import dataStructures.KittyRating; +import dataStructures.KittyRole; +import dataStructures.KittyUser; +import dataStructures.UserInput; + +public class CommandDewRealm extends SubCommand +{ + DewRealm realm; + public CommandDewRealm(KittyRole roleLevel, KittyRating contentRating) + { + super(roleLevel, contentRating); + realm = new DewRealm(); + + for(int y = 0; y < realm.map.length; ++y) + { + for(int x = 0; x < realm.map[y].length; ++x) + { + realm.map[y][x] = DewMapTile.Grass.getValue(); + } + } + } + + @Override + public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input) + { + String out = ""; + out += "**Realm ID:** `" + realm.id + "`\n"; + + for(int x = 0; x < realm.map.length; ++x) + { + out += "`"; + for(int y = 0; y < realm.map[x].length; ++y) + { + switch(DewMapTile.values()[realm.map[x][y]]) + { + case Grass: + out += ","; + break; + + default: + break; + + } + } + out += "`"; + out += "\n"; + } + + return new SubCommandFormattable(out); + } + +} diff --git a/src/commands/dew/adapter/KittyAdapterDewPlayer.java b/src/commands/dew/adapter/KittyAdapterDewPlayer.java index e98cf6b..72d60c6 100644 --- a/src/commands/dew/adapter/KittyAdapterDewPlayer.java +++ b/src/commands/dew/adapter/KittyAdapterDewPlayer.java @@ -16,4 +16,22 @@ public class KittyAdapterDewPlayer implements IDewPlayer return null; } + @Override + public String getCurrentRealm() { + // TODO Auto-generated method stub + return "0"; + } + + @Override + public int getRealmX() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getRealmY() { + // TODO Auto-generated method stub + return 0; + } + } diff --git a/src/commands/dew/core/api/IDewPlayer.java b/src/commands/dew/core/api/IDewPlayer.java index 297cad1..b1c2981 100644 --- a/src/commands/dew/core/api/IDewPlayer.java +++ b/src/commands/dew/core/api/IDewPlayer.java @@ -3,4 +3,7 @@ package commands.dew.core.api; public interface IDewPlayer extends IDewEntity { public String getName(); + public String getCurrentRealm(); + public int getRealmX(); + public int getRealmY(); } diff --git a/src/commands/dew/core/data/DewMap.java b/src/commands/dew/core/data/DewMap.java deleted file mode 100644 index 57e43a9..0000000 --- a/src/commands/dew/core/data/DewMap.java +++ /dev/null @@ -1,10 +0,0 @@ -package commands.dew.core.data; - -import commands.dew.core.api.IDewLuaSerializable; - -public final class DewMap implements IDewLuaSerializable -{ - public int mapWidth = 20; - public int mapHeight = 20; - public int[][] map; -} diff --git a/src/commands/dew/core/data/DewRealm.java b/src/commands/dew/core/data/DewRealm.java new file mode 100644 index 0000000..4db6115 --- /dev/null +++ b/src/commands/dew/core/data/DewRealm.java @@ -0,0 +1,9 @@ +package commands.dew.core.data; + +import commands.dew.core.api.IDewLuaSerializable; + +public final class DewRealm implements IDewLuaSerializable +{ + public String id = "0"; + public int[][] map = new int[12][24]; // [Rows][Columns] +}