Thread: Custom Classes!
View Single Post
  #20  
Old 12-09-2007, 11:31 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Novo View Post
But Powerful for those who know how to use it. Additionally, the merger comes with a default way of merging. It isn't necessary to define your own function, but the power is there if you do!

PHP Code:
function onCreated()
{
  
mod1 = TMap.newInstance({{"a",3}, {"b", 1}} );
  
mod2 = TMap.newInstance({{"a",2}, {"b", 1}, {"c", 1}} );

  
mod3 = TMap.merge( mod1, mod2 );
  echo( 
mod3.toArray() ); // "a,5","b,2","c,1"
} 
Simple for those who don't need more.
Can you tell me an instance where it would be used in-game?
__________________
Reply With Quote