-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPBGE: Implement range loop for CListValue.
With the new features of C++11 loops are now easily to write using the range loop syntax. But in sources we heavily used CListValue for lists accesible in python and managed in C++. CListValue wasn't supporting range loop becuase of a main rason: it was based on CValue type for item only. The first modification to allow range loop is to make CListValue use a subtype of CValue, this was done for the iterator loop with templates, but with renage loop syntax we could not specify any template parameter. To fix this issue the CListValue now use a template argument for the item type used, e.g CListValue<KX_GameObject> objects; In addition CBaseListValue class is shared by all the CListValue type to expose a common python proxy and store the item at CValue type, indeed CListValue just allow casting to upper item types. Once this the CListValue iterator can be get through the functions begin() and end() defined globally.
- Loading branch information
1 parent
48e96c8
commit 4fdab9f
Showing
27 changed files
with
569 additions
and
586 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
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
Oops, something went wrong.