56 lines
1.0 KiB
Java
56 lines
1.0 KiB
Java
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
package electrosphere.entity;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.LinkedList;
|
|
import java.util.List;
|
|
|
|
/**
|
|
*
|
|
* @author amaterasu
|
|
*/
|
|
public class Entity {
|
|
|
|
static int entity_id_iterator = 0;
|
|
|
|
int id;
|
|
|
|
HashMap<String,Object> data;
|
|
|
|
LinkedList<String> dataKeys;
|
|
|
|
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
// HashMap<String, Object> getData() {
|
|
// return data;
|
|
// }
|
|
|
|
public void putData(String key, Object o){
|
|
data.put(key,o);
|
|
dataKeys.add(key);
|
|
}
|
|
|
|
public List<String> getDataKeys(){
|
|
return dataKeys;
|
|
}
|
|
|
|
public Object getData(String key){
|
|
return data.get(key);
|
|
}
|
|
|
|
public Entity(){
|
|
data = new HashMap();
|
|
dataKeys = new LinkedList();
|
|
id = entity_id_iterator;
|
|
entity_id_iterator++;
|
|
}
|
|
}
|