+ 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
@@ -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 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 void Parse(IDewLuaSerializable item)
public static void toLua(IDewLuaSerializable item)
{
for(Field field : item.getClass().getDeclaredFields())
{
try
{
System.out.println(field.getName() + " " + field.getType() + " " + field.get(item));
}
catch (IllegalArgumentException | IllegalAccessException e)
{
e.printStackTrace();
}
}
}
}