HashMap for available assets
This commit is contained in:
parent
f02b887b8b
commit
bec4aa59a6
@ -26,8 +26,8 @@
|
|||||||
package opensesim.world;
|
package opensesim.world;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,8 +35,9 @@ import org.json.JSONObject;
|
|||||||
* @author 7u83 <7u83@mail.ru>
|
* @author 7u83 <7u83@mail.ru>
|
||||||
*/
|
*/
|
||||||
public class Account {
|
public class Account {
|
||||||
ConcurrentHashMap <AbstractAsset,Double> assets = new ConcurrentHashMap<>();
|
HashMap <AbstractAsset,Double> assets = new HashMap<>();
|
||||||
|
HashMap <AbstractAsset,Double> assets_avail = new HashMap<>();
|
||||||
|
|
||||||
Trader owner;
|
Trader owner;
|
||||||
Exchange exchange=null;
|
Exchange exchange=null;
|
||||||
|
|
||||||
@ -62,6 +63,7 @@ public class Account {
|
|||||||
|
|
||||||
void add(AssetPack pack){
|
void add(AssetPack pack){
|
||||||
assets.put( pack.asset, get(pack.asset)+pack.volume);
|
assets.put( pack.asset, get(pack.asset)+pack.volume);
|
||||||
|
assets_avail.put( pack.asset, get(pack.asset)+pack.volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double get(AbstractAsset asset){
|
public double get(AbstractAsset asset){
|
||||||
|
Loading…
Reference in New Issue
Block a user