stockNode.put("id", portfoilioStock.getId());
String ticker = portfoilioStock.getStock().getTicker();
stockNode.put("ticker", ticker);
stockNode.put("company", portfoilioStock.getStock().getCompanyName());
stockNode.put("quantity", portfoilioStock.getQuantity());
StockPrice currentStockPrice = null;
try {
currentStockPrice = gm.getStockPrice(ticker, gameState.getGame().getVirtualCurrentDate());
} catch (IOException ex) {
play.Logger.warn("error occured while retrieving price", ex);
}
stockNode.put("currentPrice", currentStockPrice != null ? currentStockPrice.getStockPrice() : 0);
//stockNode.put("purchasePrice", purchasePrice);
stocks.add(stockNode);
}
return stocks;
}