WIP minetest <-> laby import/export

- currently possible to export a laby into minetest
- start of a lua content parser to import .we into lab
This commit is contained in:
philippe lhardy
2020-11-03 23:21:29 +01:00
parent 41067707bc
commit 9355fd8b6d
11 changed files with 424 additions and 10 deletions

View File

@@ -0,0 +1,43 @@
package org.artisanlogiciel.lua;
import java.util.ArrayList;
import java.util.List;
public class LuaSequence
extends LuaObject{
List<LuaObject> items;
public LuaSequence()
{
items = new ArrayList<>();
}
void addObject(LuaObject object)
{
if ( object == null )
{
System.err.println("adding null tuple");
}
items.add(object);
}
@Override
public String toString()
{
StringBuffer buffer = new StringBuffer();
buffer.append('{');
if (items.size() > 0) {
buffer.append(items.get(0).toString());
if (items.size() > 1) {
for (int i = 1; i < items.size(); i ++)
{
buffer.append(',');
buffer.append(items.get(i).toString());
}
}
}
buffer.append('}');
return buffer.toString();
}
}