[ActionScript] What does Class() do?

38 views
Skip to first unread message

Xpol Wan

unread,
Aug 13, 2015, 4:12:52 AM8/13/15
to Ash Framework
I'm form Lua with middleclass.lua OO system. 


The code:

var newState : EntityState = states[ name ];
//...
if ( currentState )
{
   toAdd
= new Dictionary();
   
for( t in newState.providers )
   
{
     type
= Class( t );
     toAdd
[ type ] = newState.providers[ type ];
   
}
 
// ...
}


What does `type = Class( t );` do?

I think EntityState.providers already has class as key.

In lua as a class is a table, I would simpily:

for type, provider in pairs(newState.providers) do
   toAdd
[type] = provider
end

Did I missed sth?

Xpol Wan

unread,
Aug 13, 2015, 4:24:41 AM8/13/15
to Ash Framework
Oh, Is `Class(t)` just do a type cast on t?

Michael Cann

unread,
Aug 13, 2015, 4:26:19 AM8/13/15
to ash-fr...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Ash Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ash-framewor...@googlegroups.com.
Visit this group at http://groups.google.com/group/ash-framework.
For more options, visit https://groups.google.com/d/optout.



--

Xpol Wan

unread,
Aug 13, 2015, 4:50:24 AM8/13/15
to Ash Framework
Thank you Michael.
Reply all
Reply to author
Forward
0 new messages