Jump to content

View more

Image of the Day

Adding some finishing touches...
Follow us for more
#screenshotsaturday #indiedev... by #MakeGoodGames https://t.co/Otbwywbm3a
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now
- - - - -

List Pattern

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 Jason Goepel   Members   

794
Like
0Likes
Like

Posted 11 October 2013 - 11:12 AM

I see the format of the list pattern contains a "repeat" identifier.   It looks like my Matrix class (which contains doubles) would register its list factory like so:

engine->RegisterObjectBehaviour("Matrix", asBEHAVE_LIST_FACTORY, "Matrix@ f(int&in list) {repeat {repeat double}}", ...);

Is there any way to register the list pattern such that the inner lists all must have the same dimension?

Matrix A = { {1.0, 2.0}, {3.0, 4.0} };  // Successful
Matrix B = { {1.0},      {3.0, 4.0} };  // Compile Error

I realize I can inspect the pattern at runtime to determine whether it meets any special criteria.


Edited by Jason Goepel, 11 October 2013 - 11:16 AM.


#2 Andreas Jonsson   Moderators   

4653
Like
0Likes
Like

Posted 11 October 2013 - 12:39 PM

It's not yet possible to declare the pattern to guarantee that all sublists are of the same size, but it is planned. It will look something like this:

 

"Matrix@ f(int&in list) {repeat {repeat(x) double}}"


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 Jason Goepel   Members   

794
Like
0Likes
Like

Posted 11 October 2013 - 02:29 PM

Excellent.






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.