home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Esportes
/
CrossingCup.swf
/
scripts
/
__Packages
/
CTeamManager.as
< prev
next >
Wrap
Text File
|
2007-12-11
|
2KB
|
61 lines
class CTeamManager
{
function CTeamManager()
{
this.teams = new Array();
EventCenter.access().addEventListener("changeTeam",this);
}
function addTeam(id, flagid, teamname, shirtcolor1, pantscolor1, shirtcolor2, pantscolor2, goalie, cornerkicker, kicker)
{
var _loc2_ = new CTeam(id,flagid,teamname,shirtcolor1,pantscolor1,shirtcolor2,pantscolor2,goalie,cornerkicker,kicker);
this.teams.push(_loc2_);
}
function randomTeam2()
{
var _loc2_ = 0;
while(_loc2_ < 32)
{
var _loc3_ = Math.floor(Math.random() * 32);
var _loc4_ = undefined;
_loc4_ = this.teams[_loc2_];
this.teams[_loc2_] = this.teams[_loc3_];
this.teams[_loc3_] = _loc4_;
_loc2_ = _loc2_ + 1;
}
}
function randomTeam()
{
var _loc2_ = 0;
while(_loc2_ < 32)
{
var _loc3_ = Math.floor(Math.random() * 32);
var _loc4_ = undefined;
var _loc5_ = this.teams[_loc2_].id;
this.teams[_loc2_].id = this.teams[_loc3_].id;
this.teams[_loc3_].id = _loc5_;
_loc4_ = this.teams[_loc2_];
this.teams[_loc2_] = this.teams[_loc3_];
this.teams[_loc3_] = _loc4_;
_loc2_ = _loc2_ + 1;
}
}
function changeTeam(event)
{
this.currentTeam = this.teams[event.id - 1];
_global.__DISPATCH({type:"teamChanged"});
}
function getTeam()
{
return this.teams;
}
static function _buildInstance()
{
CTeamManager._oI = new CTeamManager();
return CTeamManager._oI;
}
static function ins()
{
return !(CTeamManager._oI instanceof CTeamManager) ? CTeamManager._buildInstance() : CTeamManager._oI;
}
}