Added a method for default exchange
This commit is contained in:
parent
01a5551e69
commit
d127b99372
@ -211,12 +211,27 @@ public class GodWorld implements GetJson, World {
|
||||
return a;
|
||||
}
|
||||
|
||||
HashMap<String, Exchange> exchanges = new HashMap<>();
|
||||
// --------------------------------------------------------------------
|
||||
// Exchanges in our world
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
private final HashMap<String, Exchange> exchanges = new HashMap<>();
|
||||
private Exchange default_exchange = null;
|
||||
|
||||
public void createExchange(JSONObject cfg) {
|
||||
Exchange ex = new Exchange(this.getWorld(), cfg);
|
||||
exchanges.put(ex.getSymbol(), ex);
|
||||
if (default_exchange == null) {
|
||||
default_exchange = ex;
|
||||
}
|
||||
}
|
||||
|
||||
public Exchange getDefaultExchange(){
|
||||
return default_exchange;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<Exchange> getExchangeCollection() {
|
||||
@ -366,8 +381,6 @@ public class GodWorld implements GetJson, World {
|
||||
// --------------------------------------------------------------------
|
||||
// Stuff belonging to accounts
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// Pseudo random generator stuff
|
||||
// --------------------------------------------------------------------
|
||||
|
@ -75,4 +75,9 @@ public class RealWorld implements World {
|
||||
return godworld.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Exchange getDefaultExchange() {
|
||||
return godworld.getDefaultExchange();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ public interface World {
|
||||
|
||||
Collection<Exchange> getExchangeCollection();
|
||||
|
||||
public Exchange getDefaultExchange();
|
||||
|
||||
Collection<Trader> getTradersCollection();
|
||||
|
||||
public void schedule(EventListener listener, long t);
|
||||
|
Loading…
Reference in New Issue
Block a user