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;
|
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) {
|
public void createExchange(JSONObject cfg) {
|
||||||
Exchange ex = new Exchange(this.getWorld(), cfg);
|
Exchange ex = new Exchange(this.getWorld(), cfg);
|
||||||
exchanges.put(ex.getSymbol(), ex);
|
exchanges.put(ex.getSymbol(), ex);
|
||||||
|
if (default_exchange == null) {
|
||||||
|
default_exchange = ex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Exchange getDefaultExchange(){
|
||||||
|
return default_exchange;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Exchange> getExchangeCollection() {
|
public Collection<Exchange> getExchangeCollection() {
|
||||||
@ -366,8 +381,6 @@ public class GodWorld implements GetJson, World {
|
|||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
// Stuff belonging to accounts
|
// Stuff belonging to accounts
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
// Pseudo random generator stuff
|
// Pseudo random generator stuff
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
@ -75,4 +75,9 @@ public class RealWorld implements World {
|
|||||||
return godworld.currentTimeMillis();
|
return godworld.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Exchange getDefaultExchange() {
|
||||||
|
return godworld.getDefaultExchange();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,8 @@ public interface World {
|
|||||||
public AbstractAsset getAssetBySymbol(String symbol);
|
public AbstractAsset getAssetBySymbol(String symbol);
|
||||||
|
|
||||||
Collection<Exchange> getExchangeCollection();
|
Collection<Exchange> getExchangeCollection();
|
||||||
|
|
||||||
|
public Exchange getDefaultExchange();
|
||||||
|
|
||||||
Collection<Trader> getTradersCollection();
|
Collection<Trader> getTradersCollection();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user