Start work on non-item non-creature objects
This commit is contained in:
parent
129b9d9a33
commit
3d54fe3076
23
assets/Data/objects.json
Normal file
23
assets/Data/objects.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"objects" : [
|
||||
|
||||
{
|
||||
"itemId" : "crateWooden",
|
||||
"modelPath" : "Models/crate2.fbx",
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"OUTLINE"
|
||||
],
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
@ -9,6 +9,7 @@ import electrosphere.game.data.creature.type.attack.AttackMoveResolver;
|
||||
import electrosphere.game.data.creature.type.model.CreatureTypeMap;
|
||||
import electrosphere.game.data.foliage.type.model.FoliageTypeMap;
|
||||
import electrosphere.game.data.item.type.model.ItemTypeMap;
|
||||
import electrosphere.game.data.object.type.model.ObjectTypeMap;
|
||||
import electrosphere.game.data.structure.type.model.StructureTypeMap;
|
||||
import electrosphere.game.server.race.model.RaceMap;
|
||||
import electrosphere.game.server.symbolism.model.SymbolMap;
|
||||
@ -24,6 +25,7 @@ public class Config {
|
||||
StructureTypeMap structureTypeMap;
|
||||
ItemTypeMap itemMap;
|
||||
FoliageTypeMap foliageMap;
|
||||
ObjectTypeMap objectMap;
|
||||
SymbolMap symbolMap;
|
||||
RaceMap raceMap;
|
||||
|
||||
@ -33,6 +35,7 @@ public class Config {
|
||||
config.itemMap = FileUtils.loadObjectFromAssetPath("Data/items.json", ItemTypeMap.class);
|
||||
config.structureTypeMap = FileUtils.loadObjectFromAssetPath("Data/structures.json", StructureTypeMap.class);
|
||||
config.foliageMap = FileUtils.loadObjectFromAssetPath("Data/foliage.json", FoliageTypeMap.class);
|
||||
config.objectMap = FileUtils.loadObjectFromAssetPath("Data/objects.json", ObjectTypeMap.class);
|
||||
config.symbolMap = FileUtils.loadObjectFromAssetPath("Data/symbolism.json", SymbolMap.class);
|
||||
config.raceMap = FileUtils.loadObjectFromAssetPath("Data/races.json", RaceMap.class);
|
||||
return config;
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package electrosphere.game.data.object.type;
|
||||
|
||||
import electrosphere.entity.types.hitbox.HitboxData;
|
||||
import electrosphere.game.data.creature.type.CollidableTemplate;
|
||||
import java.util.List;
|
||||
|
||||
public class Object {
|
||||
|
||||
String objectId;
|
||||
String modelPath;
|
||||
List<String> tokens;
|
||||
CollidableTemplate collidable;
|
||||
|
||||
public String getObjectId() {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
public String getModelPath() {
|
||||
return modelPath;
|
||||
}
|
||||
|
||||
public List<String> getTokens() {
|
||||
return tokens;
|
||||
}
|
||||
|
||||
public CollidableTemplate getCollidable(){
|
||||
return collidable;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package electrosphere.game.data.object.type.model;
|
||||
|
||||
import electrosphere.game.data.object.type.Object;
|
||||
import java.util.List;
|
||||
|
||||
public class ObjectTypeMap {
|
||||
List<Object> objects;
|
||||
|
||||
public List<Object> getObjects() {
|
||||
return objects;
|
||||
}
|
||||
|
||||
public Object getObject(String name){
|
||||
Object rVal = null;
|
||||
for(Object item : objects){
|
||||
if(item.getObjectId().equals(name)){
|
||||
rVal = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rVal;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user