+ Added adapter concept

This commit is contained in:
Matthew Cech
2019-09-11 19:53:20 -07:00
parent 1e73f6adae
commit cf7bd68658
5 changed files with 41 additions and 3 deletions
+1 -1
View File
@@ -109,7 +109,7 @@
"Localized Strings","DBFlushInfo","Takes all objects queued for the database and writes them to the database, then says how many were written." "Localized Strings","DBFlushInfo","Takes all objects queued for the database and writes them to the database, then says how many were written."
"Localized Strings","DBStatsInfo","Shows current statistics for the database" "Localized Strings","DBStatsInfo","Shows current statistics for the database"
"Localized Strings","DefaultDanceInfo","y'all know forknife, get ready to dance, or make a friend dance with @!" "Localized Strings","DefaultDanceInfo","y'all know forknife, get ready to dance, or make a friend dance with @!"
"Localized Strings","DewInfo","" "Localized Strings","DewInfo","A fun little dev experiment!"
"Localized Strings","DoWorkFinished","I finished with my work! :D" "Localized Strings","DoWorkFinished","I finished with my work! :D"
"Localized Strings","DoWorkInfo","Occupies a core for a few seconds" "Localized Strings","DoWorkInfo","Occupies a core for a few seconds"
"Localized Strings","EightBallError","Hmm? You'll need to ask a question!" "Localized Strings","EightBallError","Hmm? You'll need to ask a question!"
1 Type Key Value
109 Localized Strings DBFlushInfo Takes all objects queued for the database and writes them to the database, then says how many were written.
110 Localized Strings DBStatsInfo Shows current statistics for the database
111 Localized Strings DefaultDanceInfo y'all know forknife, get ready to dance, or make a friend dance with @!
112 Localized Strings DewInfo A fun little dev experiment!
113 Localized Strings DoWorkFinished I finished with my work! :D
114 Localized Strings DoWorkInfo Occupies a core for a few seconds
115 Localized Strings EightBallError Hmm? You'll need to ask a question!
@@ -0,0 +1,19 @@
package commands.dew.adapter;
import commands.dew.core.api.IDewPlayer;
public class KittyAdapterDewPlayer implements IDewPlayer
{
@Override
public String getName() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getUniqueID() {
// TODO Auto-generated method stub
return null;
}
}
@@ -3,4 +3,5 @@ package commands.dew.core.api;
public interface IDewPlayer public interface IDewPlayer
{ {
public String getName(); public String getName();
public String getUniqueID();
} }
+11
View File
@@ -0,0 +1,11 @@
package commands.dew.core.impl;
import commands.dew.core.api.IDewPlayer;
public class DewCore
{
public DewCore(IDewPlayer player)
{
}
}
+9 -2
View File
@@ -7,11 +7,18 @@ import commands.dew.core.api.IDewLuaSerializable;
public class DewLuaCore implements IDewLuaCore public class DewLuaCore implements IDewLuaCore
{ {
public void Parse(IDewLuaSerializable item) public static void toLua(IDewLuaSerializable item)
{ {
for(Field field : item.getClass().getDeclaredFields()) for(Field field : item.getClass().getDeclaredFields())
{ {
try
{
System.out.println(field.getName() + " " + field.getType() + " " + field.get(item));
}
catch (IllegalArgumentException | IllegalAccessException e)
{
e.printStackTrace();
}
} }
} }
} }