+ Added visualize basics

This commit is contained in:
Matthew Cech
2019-09-12 23:51:20 -07:00
parent b3187bb89d
commit e81e0972a3
8 changed files with 123 additions and 16 deletions
+1 -1
View File
@@ -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));
}
}
+25
View File
@@ -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;
}
}
+7 -5
View File
@@ -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)
{
+60
View File
@@ -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);
}
}
@@ -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;
}
}
@@ -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();
}
-10
View File
@@ -1,10 +0,0 @@
package commands.dew.core.data;
import commands.dew.core.api.IDewLuaSerializable;
public final class DewMap implements IDewLuaSerializable<DewMap>
{
public int mapWidth = 20;
public int mapHeight = 20;
public int[][] map;
}
+9
View File
@@ -0,0 +1,9 @@
package commands.dew.core.data;
import commands.dew.core.api.IDewLuaSerializable;
public final class DewRealm implements IDewLuaSerializable<DewRealm>
{
public String id = "0";
public int[][] map = new int[12][24]; // [Rows][Columns]
}