-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #42: iterator example udpate (TradingPool usage)
- Loading branch information
Showing
1 changed file
with
4 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -543,11 +543,12 @@ Here is a simple example: | |
// for simplicity, I will not use the Lang/Script class | ||
void OnStart() | ||
{ | ||
OrderList<Order*> list; | ||
int total= TradingPool::total(); | ||
TradingPool pool; | ||
LinkedList<Order*> list; | ||
int total= pool.total(); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dingmaotu
Author
Owner
|
||
for(int i=0; i<total; i++) | ||
{ | ||
if(TradingPool::select(i)) | ||
if(Order::Select(i)) | ||
{ | ||
OrderPrint(); // to compare with Order.toString | ||
list.push(new Order()); | ||
|
BTW,
total()
method here is a bit confusing. It shows all orders fromMODE_TRADES
with no respect to its filter. Should, for example,count()
method be added to count all orders satisfying pool's inner filter?