code
stringlengths
57
237k
package forms.battlelist { import mx.core.BitmapAsset; [ExcludeClass] public class ViewBattleList_cp extends BitmapAsset { public function ViewBattleList_cp() { super(); } } }
package alternativa.tanks.model.item.container.gui.opening { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.model.item.container.gui.opening.ContainerOpenDialog_Mote.jpg")] public class ContainerOpenDialog_Mote extends BitmapAsset { public function ContainerOpenDialog_Mote() { super(); } } }
package alternativa.tanks.gui.category { import base.DiscreteSprite; import flash.events.MouseEvent; import flash.utils.Dictionary; import projects.tanks.client.commons.types.ItemViewCategoryEnum; public class CategoryButtonsList extends DiscreteSprite { private static const SPACE_BETWEEN_BUTTON:int = 5; private var selectedCategory:ItemViewCategoryEnum; private var buttons:Vector.<ItemCategoryButton> = new Vector.<ItemCategoryButton>(); private var categoryToButton:Dictionary = new Dictionary(); private var textMaxButtonWidth:int; private var iconAndTextMaxButtonWidth:int; private var maxWidth:int = 100; public function CategoryButtonsList() { super(); this.addButton(ItemViewCategoryEnum.WEAPON); this.addButton(ItemViewCategoryEnum.ARMOR); this.addButton(ItemViewCategoryEnum.DRONE); this.addButton(ItemViewCategoryEnum.RESISTANCE); this.addButton(ItemViewCategoryEnum.PAINT); this.addButton(ItemViewCategoryEnum.INVENTORY); this.addButton(ItemViewCategoryEnum.KIT); this.addButton(ItemViewCategoryEnum.SPECIAL); this.addButton(ItemViewCategoryEnum.GIVEN_PRESENTS); this.buttons[0].enabled = false; this.selectedCategory = this.buttons[0].getCategory(); this.calculateWidth(); } public function select(param1:ItemViewCategoryEnum) : void { this.categoryToButton[this.selectedCategory].enabled = true; this.categoryToButton[param1].enabled = false; this.selectedCategory = param1; dispatchEvent(new CategoryButtonsListEvent(CategoryButtonsListEvent.CATEGORY_SELECTED,this.selectedCategory)); } public function getSelectedCategory() : ItemViewCategoryEnum { return this.selectedCategory; } public function setCategoryButtonVisibility(param1:ItemViewCategoryEnum, param2:Boolean) : void { this.categoryToButton[param1].visible = param2; this.calculateWidth(); } public function getCategoryButtonVisibility(param1:ItemViewCategoryEnum) : Boolean { return this.categoryToButton[param1].visible; } public function showNewItemIndicator(param1:ItemViewCategoryEnum) : void { this.categoryToButton[param1].showNewItemIndicator(); } public function hideNewItemIndicator(param1:ItemViewCategoryEnum) : void { this.categoryToButton[param1].hideNewItemIndicator(); } public function showDiscountIndicator(param1:ItemViewCategoryEnum) : void { this.categoryToButton[param1].showDiscountIndicator(); } public function hideDiscountIndicator(param1:ItemViewCategoryEnum) : void { this.categoryToButton[param1].hideDiscountIndicator(); } private function addButton(param1:ItemViewCategoryEnum) : void { var local2:ItemCategoryButton = new ItemCategoryButton(param1); this.buttons.push(local2); this.categoryToButton[param1] = local2; local2.addEventListener(MouseEvent.CLICK,this.onButtonClick); addChild(local2); } private function calculateWidth() : void { var local1:ItemCategoryButton = null; this.textMaxButtonWidth = this.iconAndTextMaxButtonWidth = 0; for each(local1 in this.buttons) { if(local1.visible) { local1.setTextState(); this.textMaxButtonWidth = Math.max(this.textMaxButtonWidth,local1.width); local1.setIconTextState(); this.iconAndTextMaxButtonWidth = Math.max(this.iconAndTextMaxButtonWidth,local1.width); } } this.selectLod(); } override public function get width() : Number { return this.maxWidth; } override public function set width(param1:Number) : void { this.maxWidth = param1; this.selectLod(); } private function selectLod() : void { var local3:ItemCategoryButton = null; var local4:int = 0; var local1:int = 0; var local2:int = 0; for each(local3 in this.buttons) { if(local3.visible) { local2++; } } local4 = (this.maxWidth - (local2 - 1) * SPACE_BETWEEN_BUTTON) / local2; if(local4 >= this.iconAndTextMaxButtonWidth) { local4 = Math.min(local4,this.iconAndTextMaxButtonWidth + 7); } else if(local4 >= this.textMaxButtonWidth) { local4 = Math.min(local4,this.textMaxButtonWidth + 14); } for each(local3 in this.buttons) { if(local3.visible) { if(this.iconAndTextMaxButtonWidth <= local4) { local3.setIconTextState(); local3.width = local4; } else if(this.textMaxButtonWidth <= local4) { local3.setTextState(); local3.width = local4; } else { local3.setIconState(); } local3.x = local1; local1 += local3.width; local1 += SPACE_BETWEEN_BUTTON; } } } private function onButtonClick(param1:MouseEvent) : void { if(param1.target is ItemCategoryButton) { this.select(ItemCategoryButton(param1.target).getCategory()); } } public function destroy() : void { var local1:ItemCategoryButton = null; for each(local1 in this.buttons) { local1.removeEventListener(MouseEvent.CLICK,this.onButtonClick); } this.buttons = null; this.categoryToButton = null; } public function findVisibleCategory() : ItemViewCategoryEnum { var local1:ItemCategoryButton = null; for each(local1 in this.buttons) { if(local1.visible) { return local1.getCategory(); } } throw new Error("No category to show"); } } }
package alternativa.tanks.models.sfx.colortransform { import platform.client.fp10.core.model.ObjectLoadPostListener; import projects.tanks.client.battlefield.models.tankparts.sfx.colortransform.ColorTransformModelBase; import projects.tanks.client.battlefield.models.tankparts.sfx.colortransform.IColorTransformModelBase; import projects.tanks.client.battlefield.models.tankparts.sfx.colortransform.struct.ColorTransformStruct; [ModelInfo] public class ColorTransformModel extends ColorTransformModelBase implements IColorTransformModelBase, ObjectLoadPostListener { public function ColorTransformModel() { super(); } [Obfuscation(rename="false")] public function objectLoadedPost() : void { var local1:Vector.<ColorTransformStruct> = getInitParam().colorTransforms; var local2:uint = local1.length; var local3:Vector.<ColorTransformEntry> = new Vector.<ColorTransformEntry>(local2); var local4:int = 0; while(local4 < local2) { local3[local4] = new ColorTransformEntry(local1[local4]); local4++; } if(local3.length != 0) { ColorTransformConsumer(object.event(ColorTransformConsumer)).initColorTransform(local3); } } } }
package controls.rangicons { import flash.display.DisplayObject; import flash.display.MovieClip; [Embed(source="/_assets/assets.swf", symbol="symbol359")] public class RangIconNormal extends RangIcon { public var g:MovieClip; private var gl:DisplayObject; public function RangIconNormal(param1:int = 1) { addFrameScript(0,this.frame1); super(param1); this.gl = getChildByName("g"); this.gl.visible = false; } public function set glow(param1:Boolean) : void { this.gl.visible = param1; } internal function frame1() : * { stop(); } } }
package alternativa.osgi.service.serverlog { import alternativa.osgi.service.launcherparams.LauncherParams; import flash.net.URLLoader; import flash.net.URLRequest; import flash.net.URLRequestMethod; public class ServerLoggingServiceImpl implements ServerLoggingService { private static const LOG_URL_PARAMETER_NAME:String = "serverLogUrl"; private var logUrl:String; public function ServerLoggingServiceImpl(param1:LauncherParams) { super(); this.logUrl = param1.getParameter(LOG_URL_PARAMETER_NAME); } public function sendDataToServer(param1:String) : void { var local2:URLRequest = null; if(this.logUrl) { local2 = new URLRequest("http://" + this.logUrl); local2.method = URLRequestMethod.POST; local2.data = param1; new URLLoader().load(local2); } } } }
package alternativa.tanks.gui.panel.buttons { import controls.panel.BaseButton; import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.MovieClip; import flash.events.MouseEvent; public class MainPanelSmallButton extends BaseButton { public static const BUTTON_WIDTH:int = 28; protected var _icon:Bitmap; private var _x:int; private var _y:int; private var _bitmapData:BitmapData; public function MainPanelSmallButton(param1:BitmapData, param2:int, param3:int) { this._bitmapData = param1; this._x = param2; this._y = param3; super(); } override protected function configUI() : void { bg = new MainPanelHelpButton().getChildByName("b") as MovieClip; addChild(bg); this._icon = new Bitmap(this._bitmapData); this._icon.x = this._x; this._icon.y = this._y; addChild(this._icon); } override protected function addListeners() : void { bg.gotoAndStop(2); buttonMode = true; mouseEnabled = true; mouseChildren = true; addEventListener(MouseEvent.MOUSE_OVER,this.onMouseEvent); addEventListener(MouseEvent.MOUSE_OUT,this.onMouseEvent); addEventListener(MouseEvent.MOUSE_DOWN,this.onMouseEvent); addEventListener(MouseEvent.MOUSE_UP,this.onMouseEvent); } override protected function removeListeners() : void { bg.gotoAndStop(1); buttonMode = false; mouseEnabled = false; mouseChildren = false; removeEventListener(MouseEvent.MOUSE_OVER,this.onMouseEvent); removeEventListener(MouseEvent.MOUSE_OUT,this.onMouseEvent); removeEventListener(MouseEvent.MOUSE_DOWN,this.onMouseEvent); removeEventListener(MouseEvent.MOUSE_UP,this.onMouseEvent); } override protected function onMouseEvent(param1:MouseEvent) : void { switch(param1.type) { case MouseEvent.MOUSE_OVER: this._icon.y = this._y; bg.gotoAndStop(3); break; case MouseEvent.MOUSE_OUT: this._icon.y = this._y; bg.gotoAndStop(2); break; case MouseEvent.MOUSE_DOWN: this._icon.y = this._y + 1; bg.gotoAndStop(4); break; case MouseEvent.MOUSE_UP: this._icon.y = this._y; bg.gotoAndStop(2); } } override public function get width() : Number { return BUTTON_WIDTH; } } }
package _codec.projects.tanks.client.battlefield.models.battle.battlefield.mine { import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.codec.OptionalCodecDecorator; import alternativa.protocol.impl.LengthCodecHelper; import alternativa.protocol.info.TypeCodecInfo; import projects.tanks.client.battlefield.models.battle.battlefield.mine.BattleMine; public class VectorCodecBattleMineLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecBattleMineLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new TypeCodecInfo(BattleMine,false)); if(this.optionalElement) { this.elementCodec = new OptionalCodecDecorator(this.elementCodec); } } public function decode(param1:ProtocolBuffer) : Object { var local2:int = int(LengthCodecHelper.decodeLength(param1)); var local3:Vector.<BattleMine> = new Vector.<BattleMine>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = BattleMine(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:BattleMine = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<BattleMine> = Vector.<BattleMine>(param2); var local5:int = int(local3.length); LengthCodecHelper.encodeLength(param1,local5); var local6:int = 0; while(local6 < local5) { this.elementCodec.encode(param1,local3[local6]); local6++; } } } }
package alternativa.tanks.servermodels.emailconfirm { import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; public class IEmailConfirmAdapt implements IEmailConfirm { private var object:IGameObject; private var impl:IEmailConfirm; public function IEmailConfirmAdapt(param1:IGameObject, param2:IEmailConfirm) { super(); this.object = param1; this.impl = param2; } public function startEmailConfirm(param1:String, param2:String) : void { var emailConfirmHash:String = param1; var email:String = param2; try { Model.object = this.object; this.impl.startEmailConfirm(emailConfirmHash,email); } finally { Model.popObject(); } } } }
package alternativa.tanks.models.sfx { import alternativa.engine3d.core.Object3D; import alternativa.engine3d.lights.TubeLight; import alternativa.math.Vector3; import alternativa.object.ClientObject; import alternativa.tanks.camera.GameCamera; import alternativa.tanks.models.battlefield.scene3dcontainer.Scene3DContainer; import alternativa.tanks.sfx.IGraphicEffect; import alternativa.tanks.sfx.Object3DPositionProvider; import alternativa.tanks.utils.objectpool.ObjectPool; import alternativa.tanks.utils.objectpool.PooledObject; public class TubeLightEffect extends PooledObject implements IGraphicEffect { private static const CAMERA_DISTANCE_COEF:Number = 1.5; private static const position:Vector3 = new Vector3(); private static const targetPositon:Vector3 = new Vector3(); private var light:TubeLight; private var positionProvider:Object3DPositionProvider; private var targetProvider:Object3DPositionProvider; private var animation:LightAnimation; private var currentTime:int; private var timeToLive:int; private var looped:Boolean; private var alive:Boolean; private var target:Object3D; private var container:Scene3DContainer; public function TubeLightEffect(param1:ObjectPool) { super(param1); this.light = new TubeLight(0,0,0,0,0); this.target = new Object3D(); } public function init(param1:Object3DPositionProvider, param2:Object3DPositionProvider, param3:LightAnimation, param4:Boolean = false) : void { this.initFromTime(param1,param2,param3.getLiveTime(),param3,param4); } public function initFromTime(param1:Object3DPositionProvider, param2:Object3DPositionProvider, param3:int, param4:LightAnimation, param5:Boolean = false) : void { this.positionProvider = param1; this.targetProvider = param2; this.timeToLive = param3; this.currentTime = 0; this.animation = param4; this.looped = param5; this.alive = true; } public function addToContainer(param1:Scene3DContainer) : void { this.container = param1; param1.addChild(this.light); param1.addChild(this.target); } public function play(param1:int, param2:GameCamera) : Boolean { var _loc3_:Number = NaN; var _loc4_:Number = NaN; if(this.alive) { this.animation.updateByTime(this.light,this.currentTime,this.timeToLive); this.positionProvider.updateObjectPosition(this.light,param2,param1); this.targetProvider.updateObjectPosition(this.target,param2,param1); this.currentTime += param1; position.x = this.light.x; position.y = this.light.y; position.z = this.light.z; targetPositon.x = this.target.x; targetPositon.y = this.target.y; targetPositon.z = this.target.z; _loc3_ = Vector3.distanceBetween(position,targetPositon); _loc4_ = param2.farClipping / CAMERA_DISTANCE_COEF; _loc3_ = _loc3_ > _loc4_ ? Number(Number(Number(_loc4_))) : Number(Number(Number(_loc3_))); this.light.length = _loc3_; if(this.currentTime > this.timeToLive) { if(this.looped) { this.currentTime %= this.timeToLive; } else { this.alive = false; } } this.light.lookAt(this.target.x,this.target.y,this.target.z); this.light.falloff = this.light.attenuationEnd - this.light.attenuationBegin; return this.alive; } return false; } public function destroy() : void { this.container.removeChild(this.light); this.container.removeChild(this.target); this.container = null; this.animation = null; this.positionProvider = null; } public function kill() : void { this.alive = false; } public function get owner() : ClientObject { return null; } } }
package projects.tanks.client.partners.impl.vkontakte { import alternativa.osgi.OSGi; import alternativa.protocol.IProtocol; import alternativa.protocol.OptionalMap; import alternativa.protocol.ProtocolBuffer; import flash.utils.ByteArray; import platform.client.fp10.core.model.IModel; public class VkontakteInternalLoginModelServer { private var protocol:IProtocol; private var protocolBuffer:ProtocolBuffer; private var model:IModel; public function VkontakteInternalLoginModelServer(param1:IModel) { super(); this.model = param1; var local2:ByteArray = new ByteArray(); this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol)); this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap()); } } }
package alternativa.tanks.models.battlefield.effects.levelup { import mx.core.BitmapAsset; [ExcludeClass] public class LevelUpEffect_BeamTexture extends BitmapAsset { public function LevelUpEffect_BeamTexture() { super(); } } }
package alternativa.network.command { import alternativa.protocol.codec.NullMap; import alternativa.types.Long; import flash.utils.IDataInput; public class SpaceCommand { public static const PRODUCE_HASH:int = 0; public var objectId:Long; public var methodId:Long; public var params:IDataInput; public var nullMap:NullMap; public function SpaceCommand(objectId:Long, methodId:Long, params:IDataInput, nullMap:NullMap) { super(); this.objectId = objectId; this.methodId = methodId; this.params = params; this.nullMap = nullMap; } } }
package alternativa.tanks.controller.commands { import alternativa.tanks.controller.events.CheckCallsignEvent; import alternativa.tanks.service.IEntranceServerFacade; import org.robotlegs.mvcs.Command; public class CheckCallsignCommand extends Command { [Inject] public var serverFacade:IEntranceServerFacade; [Inject] public var checkUidEvent:CheckCallsignEvent; public function CheckCallsignCommand() { super(); } override public function execute() : void { this.serverFacade.checkCallsign(this.checkUidEvent.uid); } } }
package alternativa.tanks.gui.personaldiscount { import alternativa.tanks.model.personaldiscount.PersonalDiscountModel; import controls.base.LabelBase; import controls.timer.CountDownTimer; import controls.timer.CountDownTimerOnCompleteAfter; import controls.timer.CountDownTimerOnTick; import utils.TimeFormatter; public class PersonalDiscountLabel extends LabelBase implements CountDownTimerOnCompleteAfter, CountDownTimerOnTick { private var timer:CountDownTimer; private var originText:String; public function PersonalDiscountLabel() { super(); } public function startTimer(param1:CountDownTimer) : void { this.timer = param1; if(param1.getRemainingSeconds() > 0) { this.addTimeToLabel(param1); param1.addListener(CountDownTimerOnCompleteAfter,this); param1.addListener(CountDownTimerOnTick,this); } } public function onTick(param1:CountDownTimer) : void { this.addTimeToLabel(param1); } private function addTimeToLabel(param1:CountDownTimer) : void { super.text = this.originText.replace(PersonalDiscountModel.DISCOUNT_TIMER_PATTERN,TimeFormatter.format(param1.getRemainingSeconds())); } public function onCompleteAfter(param1:CountDownTimer, param2:Boolean) : void { this.hideTime(); dispatchEvent(new PersonalDiscountTimerLabelEvent(PersonalDiscountTimerLabelEvent.TIME_ON_COMPLETE_PERSONAL_DISCOUNT_TIMER)); } public function hideTime() : void { if(this.timer != null) { super.text = this.originText; this.timer.removeListener(CountDownTimerOnCompleteAfter,this); this.timer.destroy(); this.timer = null; } } override public function set text(param1:String) : void { this.originText = param1; super.text = param1; } } }
package controls.rangicons { import mx.core.BitmapAsset; [ExcludeClass] public class RangsIcon_p25 extends BitmapAsset { public function RangsIcon_p25() { super(); } } }
package forms.contextmenu { import alternativa.osgi.service.display.IDisplay; import alternativa.osgi.service.locale.ILocaleService; import alternativa.types.Long; import controls.TankWindow; import controls.TankWindowInner; import controls.base.LabelBase; import flash.display.Shape; import flash.display.Sprite; import flash.events.Event; import flash.events.KeyboardEvent; import flash.events.MouseEvent; import flash.net.URLRequest; import flash.net.navigateToURL; import flash.system.System; import flash.utils.clearTimeout; import flash.utils.setTimeout; import forms.ColorConstants; import forms.ranks.SmallRankIcon; import forms.userlabel.UserLabel; import platform.clients.fp10.libraries.alternativapartners.service.IPartnerService; import projects.tanks.client.clans.clan.permissions.ClanAction; import projects.tanks.clients.fp10.libraries.TanksLocale; import projects.tanks.clients.fp10.libraries.tanksservices.service.battle.IBattleInfoService; import projects.tanks.clients.fp10.libraries.tanksservices.service.blockuser.IBlockUserService; import projects.tanks.clients.fp10.libraries.tanksservices.service.clan.ClanFunctionsService; import projects.tanks.clients.fp10.libraries.tanksservices.service.clan.ClanUserInfoService; import projects.tanks.clients.fp10.libraries.tanksservices.service.clan.UserClanInfo; import projects.tanks.clients.fp10.libraries.tanksservices.service.friend.battleinvite.IBattleInviteService; import projects.tanks.clients.fp10.libraries.tanksservices.service.layout.ILobbyLayoutService; import projects.tanks.clients.fp10.libraries.tanksservices.service.logging.gamescreen.UserChangeGameScreenService; import projects.tanks.clients.fp10.libraries.tanksservices.service.notifier.online.IOnlineNotifierService; import projects.tanks.clients.fp10.libraries.tanksservices.service.user.IUserInfoLabelUpdater; import projects.tanks.clients.fp10.libraries.tanksservices.service.user.IUserInfoService; import projects.tanks.clients.fp10.libraries.tanksservices.service.user.UserInfoLabelUpdaterEvent; import projects.tanks.clients.fp10.libraries.tanksservices.service.userproperties.IUserPropertiesService; import projects.tanks.clients.fp10.libraries.tanksservices.utils.AlertUtils; import projects.tanks.clients.fp10.libraries.tanksservices.utils.KeyUpListenerPriority; import projects.tanks.clients.fp10.libraries.tanksservices.utils.UidUtil; import projects.tanks.clients.fp10.libraries.tanksservices.utils.removeDisplayObject; import services.contextmenu.IContextMenuService; public class ContextMenu extends Sprite { [Inject] public static var display:IDisplay; [Inject] public static var battleInviteService:IBattleInviteService; [Inject] public static var contextMenuService:IContextMenuService; [Inject] public static var localeService:ILocaleService; [Inject] public static var onlineNotifierService:IOnlineNotifierService; [Inject] public static var userInfoService:IUserInfoService; [Inject] public static var battleInfoService:IBattleInfoService; [Inject] public static var blockUserService:IBlockUserService; [Inject] public static var userPropertiesService:IUserPropertiesService; [Inject] public static var partnerService:IPartnerService; [Inject] public static var userChangeGameScreenService:UserChangeGameScreenService; [Inject] public static var clanFunctionsService:ClanFunctionsService; [Inject] public static var clanUserInfoService:ClanUserInfoService; [Inject] public static var lobbyLayoutService:ILobbyLayoutService; private static const WINDOW_MARGIN:int = 11; private static const HIDE_DELAY_MS:int = 10000; private static const LINE_COLOR:uint = 1723412; private var _window:TankWindow; private var _windowInner:TankWindowInner; private var _uidLabel:LabelBase; private var _onlineLabel:LabelBase; private var _addToFriendsLabel:ContextMenuLabel; private var _acceptRequestLabel:ContextMenuLabel; private var _rejectRequestLabel:ContextMenuLabel; private var _copyUidLabel:ContextMenuLabel; private var _writeInPublicLabel:ContextMenuLabel; private var _writeInPrivateLabel:ContextMenuLabel; private var _blockUserLabel:ContextMenuLabel; private var _unblockUserLabel:ContextMenuLabel; private var _inviteBattleLabel:BattleInviteContextMenuLabel; private var _focusOnUserLabel:ContextMenuLabel; private var _voteUserLabel:ContextMenuLabel; private var _inviteToClanLabel:ContextMenuLabel; private var _showClanProfileLabel:ContextMenuLabel; private var _profileLink:ContextMenuLabel; private var _labels:Vector.<ContextMenuLabel>; private var _visibleLabels:Vector.<ContextMenuLabel>; private var _userId:Long; private var _uid:String; private var _rank:int; private var _rankIcon:SmallRankIcon; private var _hideTimeOut:uint; private var _setEventTimeOut:uint; private var _isOver:Boolean; private var _hasEventListener:Boolean; private var _isInit:Boolean; private var _line:Shape; private var _userInfoUpdater:IUserInfoLabelUpdater; private var _clanId:Long; private var isInviteToGroupEnabled:Boolean; public function ContextMenu() { super(); } public function show(param1:Long, param2:int, param3:String, param4:Boolean, param5:Boolean, param6:Boolean, param7:Boolean, param8:Boolean, param9:Boolean, param10:Boolean, param11:Boolean, param12:Boolean, param13:Boolean, param14:Boolean = true) : void { var local20:Boolean = false; var local21:Boolean = false; if(!this._isInit) { this._isInit = true; this.init(); } this.x = display.stage.mouseX; this.y = display.stage.mouseY; this.isInviteToGroupEnabled = this.isInviteToGroupEnabled; this._userId = param1; this._uid = param3; this._rank = param2; this._rankIcon.setDefaultAccount(param2); this._uidLabel.text = param3; this._uidLabel.color = param5 ? ColorConstants.FRIEND_COLOR : ColorConstants.GREEN_LABEL; if(param5) { this.updateOnlineStatus(); this._userInfoUpdater = userInfoService.getOrCreateUpdater(this._userId); } this._onlineLabel.visible = param5; this._addToFriendsLabel.visible = param4; this._acceptRequestLabel.visible = param6; this._rejectRequestLabel.visible = param7; this._writeInPublicLabel.visible = param8; this._writeInPrivateLabel.visible = param9; if(param10) { local20 = Boolean(blockUserService.isBlocked(param3)); this._blockUserLabel.visible = !local20; this._unblockUserLabel.visible = local20; } else { this._blockUserLabel.visible = false; this._unblockUserLabel.visible = false; } this._inviteBattleLabel.visible = param11 && Boolean(battleInviteService.getAvailabilityInviteBattle(param1)); this._focusOnUserLabel.visible = param12; this._showClanProfileLabel.visible = false; this._inviteToClanLabel.visible = false; this._voteUserLabel.visible = battleInfoService.isInBattle(); var local15:UserClanInfo = clanUserInfoService.userClanInfoByUserId(this._userId); var local16:UserClanInfo = clanUserInfoService.userClanInfoByUserId(userPropertiesService.userId); var local17:Boolean = local16 != null && local16.clanActions.indexOf(ClanAction.INVITE_TO_CLAN) != -1; if(local15 != null) { local21 = local15.isInClan && local16.clanId != Long.ZERO && Boolean(lobbyLayoutService.inBattle()) && local16.clanId == local15.clanId; this._showClanProfileLabel.visible = local15.isInClan && !local21 && param13; this._inviteToClanLabel.visible = param14 && (!local15.isInClan && local17) && this._rank >= local16.minRankForJoinClan; this._clanId = local15.clanId; } this._visibleLabels.length = 0; var local18:int = int(this._labels.length); var local19:int = 0; while(local19 < local18) { if(this._labels[local19].visible) { this._visibleLabels.push(this._labels[local19]); } local19++; } this.resize(); display.noticesLayer.addChild(this); clearTimeout(this._hideTimeOut); this._hideTimeOut = setTimeout(this.onHideTimeOut,HIDE_DELAY_MS); clearTimeout(this._setEventTimeOut); this._setEventTimeOut = setTimeout(this.setEvent,0); } private function updateOnlineStatus() : void { var local1:Boolean = Boolean(onlineNotifierService.hasUserOnlineData(this._userId)) && Boolean(onlineNotifierService.getUserOnlineData(this._userId).online); this._onlineLabel.color = local1 ? ColorConstants.CHAT_LABEL : ColorConstants.ACCESS_LABEL; if(local1) { this._uidLabel.color = ColorConstants.FRIEND_COLOR; this._onlineLabel.color = ColorConstants.CHAT_LABEL; this._onlineLabel.text = localeService.getText(TanksLocale.TEXT_ONLINE_LABEL); } else { this._uidLabel.color = ColorConstants.ACCESS_LABEL; this._onlineLabel.color = ColorConstants.ACCESS_LABEL; this._onlineLabel.text = localeService.getText(TanksLocale.TEXT_OFFLINE_LABEL); } this.updateInviteBattleAvailability(local1); } private function updateInviteBattleAvailability(param1:Boolean) : void { this._inviteBattleLabel.locked = !(param1 && Boolean(battleInfoService.availableRank(this._rank))); } private function init() : void { tabEnabled = false; tabChildren = false; this._window = new TankWindow(); addChild(this._window); this._windowInner = new TankWindowInner(0,0,TankWindowInner.GREEN); addChild(this._windowInner); this._uidLabel = new LabelBase(); this._uidLabel.mouseEnabled = false; addChild(this._uidLabel); this._rankIcon = new SmallRankIcon(); addChild(this._rankIcon); this._onlineLabel = new LabelBase(); addChild(this._onlineLabel); this._labels = new Vector.<ContextMenuLabel>(); this._visibleLabels = new Vector.<ContextMenuLabel>(); this._addToFriendsLabel = new ContextMenuLabel(); this._addToFriendsLabel.text = localeService.getText(TanksLocale.TEXT_FRIENDS_ADD); addChild(this._addToFriendsLabel); this._acceptRequestLabel = new ContextMenuLabel(); this._acceptRequestLabel.text = localeService.getText(TanksLocale.TEXT_FRIENDS_CONFIRM_REQUEST); addChild(this._acceptRequestLabel); this._rejectRequestLabel = new ContextMenuLabel(); this._rejectRequestLabel.text = localeService.getText(TanksLocale.TEXT_FRIENDS_DECLINE_REQUEST); addChild(this._rejectRequestLabel); this._copyUidLabel = new ContextMenuLabel(); this._copyUidLabel.text = localeService.getText(TanksLocale.TEXT_FRIENDS_COPY_NAME); addChild(this._copyUidLabel); this._writeInPublicLabel = new ContextMenuLabel(); this._writeInPublicLabel.text = localeService.getText(TanksLocale.TEXT_LOBBY_CHAT_WRITE_PUBLICLY); addChild(this._writeInPublicLabel); this._writeInPrivateLabel = new ContextMenuLabel(); this._writeInPrivateLabel.text = localeService.getText(TanksLocale.TEXT_LOBBY_CHAT_WRITE_PRIVATELY); addChild(this._writeInPrivateLabel); this._blockUserLabel = new ContextMenuLabel(); this._blockUserLabel.text = localeService.getText(TanksLocale.TEXT_BLOCK_USER_CONTEXT_MENU_LABEL); addChild(this._blockUserLabel); this._unblockUserLabel = new ContextMenuLabel(); this._unblockUserLabel.text = localeService.getText(TanksLocale.TEXT_UNBLOCK_USER_CONTEXT_MENU_LABEL); addChild(this._unblockUserLabel); this._inviteBattleLabel = new BattleInviteContextMenuLabel(); this._inviteBattleLabel.text = localeService.getText(TanksLocale.TEXT_INVITE_TO_BATTLE_LABEL); addChild(this._inviteBattleLabel); this._focusOnUserLabel = new ContextMenuLabel(); this._focusOnUserLabel.text = localeService.getText(TanksLocale.TEXT_SPECTATE_TEXT); addChild(this._focusOnUserLabel); this._inviteToClanLabel = new ContextMenuLabel(); this._inviteToClanLabel.text = localeService.getText(TanksLocale.TEXT_CLAN_INVITE_TO_CLAN); addChild(this._inviteToClanLabel); this._showClanProfileLabel = new ContextMenuLabel(); this._showClanProfileLabel.text = localeService.getText(TanksLocale.TEXT_CLAN_PROFILE); addChild(this._showClanProfileLabel); this._profileLink = new ContextMenuLabel(); this._profileLink.text = localeService.getText(TanksLocale.TEXT_PROFILE); if(!partnerService.isRunningInsidePartnerEnvironment() || Boolean(partnerService.hasRatings())) { addChild(this._profileLink); } this._voteUserLabel = new ContextMenuLabel(); this._voteUserLabel.text = localeService.getText(TanksLocale.STRING_VOTE_USER_LABEL); addChild(this._voteUserLabel); this._labels.push(this._writeInPublicLabel); this._labels.push(this._writeInPrivateLabel); this._labels.push(this._copyUidLabel); this._labels.push(this._addToFriendsLabel); this._labels.push(this._acceptRequestLabel); this._labels.push(this._rejectRequestLabel); this._labels.push(this._inviteBattleLabel); this._labels.push(this._blockUserLabel); this._labels.push(this._unblockUserLabel); this._labels.push(this._focusOnUserLabel); this._labels.push(this._profileLink); this._labels.push(this._inviteToClanLabel); this._labels.push(this._showClanProfileLabel); this._labels.push(this._voteUserLabel); this._line = new Shape(); addChild(this._line); this.resize(); display.stage.addEventListener(MouseEvent.CLICK,this.onContextMenuClickStage); display.stage.addEventListener(Event.DEACTIVATE,this.onContextMenuDeactivate); display.stage.addEventListener(KeyboardEvent.KEY_UP,this.onKeyUp,false,KeyUpListenerPriority.CONTEXT_MENU); } private function resize() : void { var local2:int = 0; var local6:Number = NaN; var local7:ContextMenuLabel = null; var local8:int = 0; this._rankIcon.x = WINDOW_MARGIN + 7; this._rankIcon.y = WINDOW_MARGIN + 8; this._uidLabel.x = this._rankIcon.x + this._rankIcon.width; this._uidLabel.y = WINDOW_MARGIN + 5; this._onlineLabel.x = WINDOW_MARGIN + 5; this._onlineLabel.y = this._uidLabel.y + this._uidLabel.height - 1; var local1:int = this._uidLabel.x + this._uidLabel.width; var local3:int = int(this._visibleLabels.length); var local4:int = 0; while(local4 < local3) { local7 = this._visibleLabels[local4]; local7.x = WINDOW_MARGIN + 5; if(local4 == 0) { local7.y = this._onlineLabel.visible ? 59 : 42; } else { local7.y = this._visibleLabels[local4 - 1].y + 18; } local2 = local7.y + 18; local8 = local7.x + local7.width; if(local8 > local1) { local1 = local8; } local4++; } local3 = int(this._labels.length); var local5:int = 0; while(local5 < local3) { if(!this._labels[local5].visible) { this._labels[local5].y = 0; } local5++; } this._line.graphics.clear(); this._line.graphics.beginFill(LINE_COLOR,1); if(this._onlineLabel.visible) { local6 = this._onlineLabel.y + this._onlineLabel.height + 5; } else { local6 = this._uidLabel.y + this._uidLabel.height + 4; } this._line.graphics.drawRect(WINDOW_MARGIN + 7,local6,local1 - WINDOW_MARGIN - 8,1); this._line.graphics.endFill(); this._window.width = local1 + WINDOW_MARGIN + 7; this._window.height = local2 + WINDOW_MARGIN + 8; this._windowInner.x = WINDOW_MARGIN; this._windowInner.y = WINDOW_MARGIN; this._windowInner.width = this._window.width - WINDOW_MARGIN * 2; this._windowInner.height = this._window.height - WINDOW_MARGIN * 2; if(this.x + this._window.width > display.stage.stageWidth) { this.x = display.stage.stageWidth - this._window.width; } if(this.y + this._window.height > display.stage.stageHeight) { this.y = display.stage.stageHeight - this._window.height; } } private function onHideTimeOut() : void { if(!this._isOver) { this.hide(); } } private function setEvent() : void { if(!this._hasEventListener) { this._hasEventListener = true; this._addToFriendsLabel.addEventListener(MouseEvent.CLICK,this.onAddToFriendClick); this._acceptRequestLabel.addEventListener(MouseEvent.CLICK,this.onAcceptRequestClick); this._rejectRequestLabel.addEventListener(MouseEvent.CLICK,this.onRejectRequestClick); this._copyUidLabel.addEventListener(MouseEvent.CLICK,this.onCopyUidClick); this._writeInPublicLabel.addEventListener(MouseEvent.CLICK,this.onWriteInPublicClick); this._writeInPrivateLabel.addEventListener(MouseEvent.CLICK,this.onWriteInPrivateClick); this._blockUserLabel.addEventListener(MouseEvent.CLICK,this.onBlockUserClick); this._unblockUserLabel.addEventListener(MouseEvent.CLICK,this.onUnblockUserClick); this._inviteBattleLabel.addEventListener(MouseEvent.CLICK,this.onInvitationToBattleClick); this._focusOnUserLabel.addEventListener(MouseEvent.CLICK,this.onFocusOnUserClick); this._profileLink.addEventListener(MouseEvent.CLICK,this.onProfileLinkClick); this._inviteToClanLabel.addEventListener(MouseEvent.CLICK,this.onInviteToClanClick); this._showClanProfileLabel.addEventListener(MouseEvent.CLICK,this.onShowClanProfile); this._voteUserLabel.addEventListener(MouseEvent.CLICK,this.onVoteUser); if(this._userInfoUpdater != null) { this._userInfoUpdater.addEventListener(UserInfoLabelUpdaterEvent.CHANGE_ONLINE,this.onChangeOnline); } this.addEventListener(MouseEvent.ROLL_OVER,this.onRollOver); this.addEventListener(MouseEvent.ROLL_OUT,this.onRollOut); } } private function onInviteToClanClick(param1:MouseEvent) : void { clanFunctionsService.invite(this._userId); this.hide(); } private function onShowClanProfile(param1:MouseEvent) : void { if(this._clanId != null) { contextMenuService.showClan(this._clanId); } this.hide(); } private function onAddToFriendClick(param1:MouseEvent) : void { contextMenuService.addToFriend(this._userId); this.hide(); } private function onAcceptRequestClick(param1:MouseEvent) : void { contextMenuService.acceptRequest(this._userId,this._uid); this.hide(); } private function onRejectRequestClick(param1:MouseEvent) : void { contextMenuService.rejectRequest(this._userId,this._uid); this.hide(); } private function onProfileLinkClick(param1:MouseEvent) : void { userChangeGameScreenService.showUserStatistics(); var local2:URLRequest = new URLRequest(userPropertiesService.getUserProfileUrl(this._uidLabel.text)); navigateToURL(local2,"_blank"); } private function onCopyUidClick(param1:MouseEvent) : void { System.setClipboard(UidUtil.userNameWithoutClanTag(this._uidLabel.text)); this.hide(); } private function onWriteInPublicClick(param1:MouseEvent) : void { contextMenuService.writeInPublic(this._userId,this._uid); this.hide(); } private function onWriteInPrivateClick(param1:MouseEvent) : void { contextMenuService.writeInPrivate(this._userId,this._uid); this.hide(); } private function onBlockUserClick(param1:MouseEvent) : void { blockUserService.blockUser(this._uid); this.hide(); } private function onUnblockUserClick(param1:MouseEvent) : void { blockUserService.unblockUser(this._uid); this.hide(); } private function onInvitationToBattleClick(param1:MouseEvent) : void { battleInviteService.invite(this._userId); this.hide(); } private function onFocusOnUserClick(param1:MouseEvent) : void { contextMenuService.focusOnUser(this._userId,this._uid); this.hide(); } private function onVoteUser(param1:MouseEvent) : * { contextMenuService.voteUser(this._userId,this._uid); this.hide(); } private function onChangeOnline(param1:UserInfoLabelUpdaterEvent) : void { this.updateOnlineStatus(); } private function onRollOver(param1:MouseEvent) : void { this._isOver = true; clearTimeout(this._hideTimeOut); } private function onRollOut(param1:MouseEvent) : void { this._isOver = false; clearTimeout(this._hideTimeOut); this._hideTimeOut = setTimeout(this.onHideTimeOut,HIDE_DELAY_MS); } private function onContextMenuClickStage(param1:MouseEvent) : void { if(!this._hasEventListener || this._isOver) { return; } var local2:UserLabel = param1.target as UserLabel; if(local2 == null || local2.self) { this.hide(); } } private function onKeyUp(param1:KeyboardEvent) : void { if(!this._hasEventListener) { return; } if(AlertUtils.isCancelKey(param1.keyCode)) { param1.stopImmediatePropagation(); this.hide(); } } private function onContextMenuDeactivate(param1:Event) : void { this.hide(); } private function hide() : void { this._userInfoUpdater = null; clearTimeout(this._hideTimeOut); clearTimeout(this._setEventTimeOut); removeDisplayObject(this); this.removeEvents(); } private function removeEvents() : void { if(this._hasEventListener) { this._hasEventListener = false; this._addToFriendsLabel.removeEventListener(MouseEvent.CLICK,this.onAddToFriendClick); this._acceptRequestLabel.removeEventListener(MouseEvent.CLICK,this.onAcceptRequestClick); this._rejectRequestLabel.removeEventListener(MouseEvent.CLICK,this.onRejectRequestClick); this._copyUidLabel.removeEventListener(MouseEvent.CLICK,this.onCopyUidClick); this._writeInPublicLabel.removeEventListener(MouseEvent.CLICK,this.onWriteInPublicClick); this._writeInPrivateLabel.removeEventListener(MouseEvent.CLICK,this.onWriteInPrivateClick); this._blockUserLabel.removeEventListener(MouseEvent.CLICK,this.onBlockUserClick); this._unblockUserLabel.removeEventListener(MouseEvent.CLICK,this.onUnblockUserClick); this._inviteBattleLabel.removeEventListener(MouseEvent.CLICK,this.onInvitationToBattleClick); this._focusOnUserLabel.removeEventListener(MouseEvent.CLICK,this.onFocusOnUserClick); this._profileLink.removeEventListener(MouseEvent.CLICK,this.onProfileLinkClick); this._inviteToClanLabel.removeEventListener(MouseEvent.CLICK,this.onInviteToClanClick); this._showClanProfileLabel.removeEventListener(MouseEvent.CLICK,this.onShowClanProfile); this._voteUserLabel.removeEventListener(MouseEvent.CLICK,this.onVoteUser); if(this._userInfoUpdater != null) { this._userInfoUpdater.removeEventListener(UserInfoLabelUpdaterEvent.CHANGE_ONLINE,this.onChangeOnline); } this.removeEventListener(MouseEvent.ROLL_OVER,this.onRollOver); this.removeEventListener(MouseEvent.ROLL_OUT,this.onRollOut); } } } }
package alternativa.tanks.view.battleinfo.renderer { import controls.cellrenderer.ButtonState; import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.Graphics; public class CellBlue extends ButtonState { private static const cellFullLeft:Class = CellBlue_cellFullLeft; private static const cellFullLeftData:BitmapData = Bitmap(new cellFullLeft()).bitmapData; private static const cellFullCenter:Class = CellBlue_cellFullCenter; private static const cellFullCenterData:BitmapData = Bitmap(new cellFullCenter()).bitmapData; private static const cellFullRight:Class = CellBlue_cellFullRight; private static const cellFullRightData:BitmapData = Bitmap(new cellFullRight()).bitmapData; public function CellBlue() { super(); bmpLeft = cellFullLeftData; bmpCenter = cellFullCenterData; bmpRight = cellFullRightData; } override public function draw() : void { var local1:Graphics = null; local1 = l.graphics; local1.clear(); local1.beginBitmapFill(bmpLeft); local1.drawRect(0,0,5,20); local1.endFill(); l.x = 0; l.y = 0; local1 = c.graphics; local1.clear(); local1.beginBitmapFill(bmpCenter); local1.drawRect(0,0,_width - 10,20); local1.endFill(); c.x = 5; c.y = 0; local1 = r.graphics; local1.clear(); local1.beginBitmapFill(bmpRight); local1.drawRect(0,0,5,20); local1.endFill(); r.x = _width - 5; r.y = 0; } } }
package alternativa.tanks.model.bonus.showing.info { import platform.client.fp10.core.resource.types.LocalizedImageResource; import projects.tanks.client.panel.model.bonus.showing.info.BonusInfoModelBase; import projects.tanks.client.panel.model.bonus.showing.info.IBonusInfoModelBase; [ModelInfo] public class BonusInfoModel extends BonusInfoModelBase implements IBonusInfoModelBase, BonusInfo { public function BonusInfoModel() { super(); } public function getTopText() : String { return getInitParam().topText; } public function getBottomText() : String { return getInitParam().bottomText; } public function getImage() : LocalizedImageResource { return getInitParam().image; } } }
package _codec.projects.tanks.client.panel.model.shop.premiumpackage { import alternativa.osgi.OSGi; import alternativa.osgi.service.clientlog.IClientLog; import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.TypeCodecInfo; import projects.tanks.client.panel.model.shop.premiumpackage.PremiumPackageCC; public class CodecPremiumPackageCC implements ICodec { public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog)); private var codec_durationInDays:ICodec; public function CodecPremiumPackageCC() { super(); } public function init(param1:IProtocol) : void { this.codec_durationInDays = param1.getCodec(new TypeCodecInfo(int,false)); } public function decode(param1:ProtocolBuffer) : Object { var local2:PremiumPackageCC = new PremiumPackageCC(); local2.durationInDays = this.codec_durationInDays.decode(param1) as int; return local2; } public function encode(param1:ProtocolBuffer, param2:Object) : void { if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:PremiumPackageCC = PremiumPackageCC(param2); this.codec_durationInDays.encode(param1,local3.durationInDays); } } }
package controls.buttons.h30px { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/controls.buttons.h30px.H30ButtonSkin_disableLeftClass.png")] public class H30ButtonSkin_disableLeftClass extends BitmapAsset { public function H30ButtonSkin_disableLeftClass() { super(); } } }
package assets.scroller { import flash.display.BitmapData; public class ThumbTop extends BitmapData { public function ThumbTop(param1:int, param2:int, param3:Boolean = true, param4:uint = 4294967295) { super(param1,param2,param3,param4); } } }
package projects.tanks.client.battlefield.models.user.temperature { import alternativa.osgi.OSGi; import alternativa.protocol.IProtocol; import alternativa.protocol.OptionalMap; import alternativa.protocol.ProtocolBuffer; import flash.utils.ByteArray; import platform.client.fp10.core.model.IModel; public class TankTemperatureModelServer { private var protocol:IProtocol; private var protocolBuffer:ProtocolBuffer; private var model:IModel; public function TankTemperatureModelServer(param1:IModel) { super(); this.model = param1; var local2:ByteArray = new ByteArray(); this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol)); this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap()); } } }
package alternativa.tanks.config { import alternativa.proplib.PropLibRegistry; import alternativa.utils.TaskSequence; import flash.events.Event; import flash.events.EventDispatcher; import specter.utils.Logger; [Event(name="complete",type="flash.events.Event")] public class Config extends EventDispatcher { public var json:String; public var map:TanksMap; public var propLibRegistry:PropLibRegistry; private var taskSequence:TaskSequence; public function Config() { super(); } public function load(url:String, mapId:String) : void { Logger.log("Loading map config"); this.taskSequence = new TaskSequence(); this.taskSequence.addTask(new ConfigXMLLoader(url,this)); this.taskSequence.addTask(new PropLibsLoader(this)); this.map = new TanksMap(this,mapId); this.taskSequence.addTask(this.map); this.taskSequence.addEventListener(Event.COMPLETE,this.onSequenceComplete); this.taskSequence.run(); } private function onSequenceComplete(event:Event) : void { this.taskSequence = null; dispatchEvent(new Event(Event.COMPLETE)); } } } import alternativa.tanks.config.Config; import alternativa.utils.Task; import flash.events.Event; import flash.net.URLLoader; import flash.net.URLLoaderDataFormat; import flash.net.URLRequest; import specter.utils.Logger; class ConfigXMLLoader extends Task { private var config:Config; private var loader:URLLoader; private var url:String; function ConfigXMLLoader(url:String, config:Config) { super(); this.url = url; this.config = config; } override public function run() : void { Logger.log("Loading map config from: " + this.url); this.loader = new URLLoader(); this.loader.dataFormat = URLLoaderDataFormat.TEXT; this.loader.addEventListener(Event.COMPLETE,this.onLoadingComplete); this.loader.load(new URLRequest(this.url)); } private function onLoadingComplete(event:Event) : void { this.config.json = String(this.loader.data); this.loader = null; completeTask(); Logger.log("Loaded map config"); } }
package alternativa.engine3d.core { import alternativa.engine3d.alternativa3d; import alternativa.engine3d.lights.OmniLight; import alternativa.engine3d.lights.SpotLight; import alternativa.engine3d.lights.TubeLight; import alternativa.engine3d.materials.TextureMaterial; import alternativa.engine3d.objects.BSP; import alternativa.engine3d.objects.Mesh; import alternativa.gfx.core.BitmapTextureResource; import alternativa.gfx.core.Device; import alternativa.gfx.core.IndexBufferResource; import alternativa.gfx.core.ProgramResource; import alternativa.gfx.core.RenderTargetTextureResource; import alternativa.gfx.core.VertexBufferResource; import flash.display.BitmapData; import flash.display3D.Context3DBlendFactor; import flash.display3D.Context3DProgramType; import flash.display3D.Context3DVertexBufferFormat; import flash.geom.Rectangle; import flash.utils.ByteArray; use namespace alternativa3d; public class DepthRenderer { private static const limit2const:int = 62; private static const limit5const:int = 24; private var depthPrograms:Array; private var correction:Vector.<Number>; private var depthFragment:Vector.<Number>; private var alphaTestConst:Vector.<Number>; private var ssaoProgram:ProgramResource; private var ssaoVertexBuffer:VertexBufferResource; private var ssaoIndexBuffer:IndexBufferResource; private var ssaoVertex:Vector.<Number>; private var ssaoFragment:Vector.<Number>; private var blurProgram:ProgramResource; private var blurFragment:Vector.<Number>; private var omniProgram:ProgramResource; private var spotProgram:ProgramResource; private var tubeProgram:ProgramResource; private var lightConst:Vector.<Number>; private var lightVertexBuffer:VertexBufferResource; private var lightIndexBuffer:IndexBufferResource; alternativa3d var depthBuffer:RenderTargetTextureResource; alternativa3d var lightBuffer:RenderTargetTextureResource; private var temporaryBuffer:RenderTargetTextureResource; private var scissor:Rectangle; private var table:BitmapTextureResource; private var noise:BitmapTextureResource; private var bias:Number = 0.1; private var tableSize:int = 128; private var noiseSize:int = 4; private var blurSamples:int = 16; private var intensity:Number = 2.5; private var noiseRandom:Number = 0.2; private var samples:int = 6; private var noiseAngle:Number; alternativa3d var correctionX:Number; alternativa3d var correctionY:Number; public function DepthRenderer() { var _loc1_:int = 0; var _loc2_:int = 0; var _loc11_:int = 0; var _loc12_:int = 0; var _loc13_:int = 0; var _loc14_:int = 0; var _loc15_:int = 0; var _loc16_:int = 0; var _loc17_:int = 0; var _loc18_:int = 0; var _loc19_:int = 0; var _loc20_:int = 0; var _loc21_:Number = NaN; var _loc22_:Number = NaN; var _loc23_:Number = NaN; var _loc24_:Number = NaN; var _loc25_:int = 0; var _loc26_:int = 0; var _loc27_:int = 0; this.depthPrograms = new Array(); this.correction = Vector.<Number>([0,0,0,1,0,0,0,1,0,0,0,0.5]); this.depthFragment = Vector.<Number>([1 / 255,0,0,1,0.5,0.5,0,1]); this.alphaTestConst = Vector.<Number>([0,0,0,1]); this.ssaoVertexBuffer = new VertexBufferResource(Vector.<Number>([-1,1,0,0,0,-1,-1,0,0,1,1,-1,0,1,1,1,1,0,1,0]),5); this.ssaoIndexBuffer = new IndexBufferResource(Vector.<uint>([0,1,3,2,3,1])); this.ssaoVertex = Vector.<Number>([0,0,0,1,0,0,0,1,1,1,0,1]); this.ssaoFragment = Vector.<Number>([0,0,0,Math.PI * 2,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,1,0,0,Math.PI * 2,Math.PI * 2]); this.blurFragment = Vector.<Number>([0,0,0,1,0,0,0,1]); this.lightConst = new Vector.<Number>(); this.scissor = new Rectangle(); this.noiseAngle = Math.PI * 2 / this.samples; super(); var _loc3_:int = 0; var _loc4_:int = 0; var _loc5_:Vector.<Number> = new Vector.<Number>(); var _loc6_:Vector.<uint> = new Vector.<uint>(); _loc1_ = 0; while(_loc1_ < limit2const) { _loc11_ = 4 + _loc1_ * 2; _loc12_ = 4 + _loc1_ * 5; _loc13_ = _loc1_ * 8; _loc5_[_loc3_] = -1; _loc3_++; _loc5_[_loc3_] = 1; _loc3_++; _loc5_[_loc3_] = -1; _loc3_++; _loc5_[_loc3_] = _loc11_; _loc3_++; _loc5_[_loc3_] = _loc12_; _loc3_++; _loc14_ = _loc13_ + 1; _loc5_[_loc3_] = 1; _loc3_++; _loc5_[_loc3_] = 1; _loc3_++; _loc5_[_loc3_] = -1; _loc3_++; _loc5_[_loc3_] = _loc11_; _loc3_++; _loc5_[_loc3_] = _loc12_; _loc3_++; _loc15_ = _loc14_ + 1; _loc5_[_loc3_] = 1; _loc3_++; _loc5_[_loc3_] = 1; _loc3_++; _loc5_[_loc3_] = 1; _loc3_++; _loc5_[_loc3_] = _loc11_; _loc3_++; _loc5_[_loc3_] = _loc12_; _loc3_++; _loc16_ = _loc15_ + 1; _loc5_[_loc3_] = -1; _loc3_++; _loc5_[_loc3_] = 1; _loc3_++; _loc5_[_loc3_] = 1; _loc3_++; _loc5_[_loc3_] = _loc11_; _loc3_++; _loc5_[_loc3_] = _loc12_; _loc3_++; _loc17_ = _loc16_ + 1; _loc5_[_loc3_] = -1; _loc3_++; _loc5_[_loc3_] = -1; _loc3_++; _loc5_[_loc3_] = -1; _loc3_++; _loc5_[_loc3_] = _loc11_; _loc3_++; _loc5_[_loc3_] = _loc12_; _loc3_++; _loc18_ = _loc17_ + 1; _loc5_[_loc3_] = 1; _loc3_++; _loc5_[_loc3_] = -1; _loc3_++; _loc5_[_loc3_] = -1; _loc3_++; _loc5_[_loc3_] = _loc11_; _loc3_++; _loc5_[_loc3_] = _loc12_; _loc3_++; _loc19_ = _loc18_ + 1; _loc5_[_loc3_] = 1; _loc3_++; _loc5_[_loc3_] = -1; _loc3_++; _loc5_[_loc3_] = 1; _loc3_++; _loc5_[_loc3_] = _loc11_; _loc3_++; _loc5_[_loc3_] = _loc12_; _loc3_++; _loc20_ = _loc19_ + 1; _loc5_[_loc3_] = -1; _loc3_++; _loc5_[_loc3_] = -1; _loc3_++; _loc5_[_loc3_] = 1; _loc3_++; _loc5_[_loc3_] = _loc11_; _loc3_++; _loc5_[_loc3_] = _loc12_; _loc3_++; _loc6_[_loc4_] = _loc13_; _loc4_++; _loc6_[_loc4_] = _loc17_; _loc4_++; _loc6_[_loc4_] = _loc14_; _loc4_++; _loc6_[_loc4_] = _loc14_; _loc4_++; _loc6_[_loc4_] = _loc17_; _loc4_++; _loc6_[_loc4_] = _loc18_; _loc4_++; _loc6_[_loc4_] = _loc14_; _loc4_++; _loc6_[_loc4_] = _loc18_; _loc4_++; _loc6_[_loc4_] = _loc19_; _loc4_++; _loc6_[_loc4_] = _loc14_; _loc4_++; _loc6_[_loc4_] = _loc19_; _loc4_++; _loc6_[_loc4_] = _loc15_; _loc4_++; _loc6_[_loc4_] = _loc17_; _loc4_++; _loc6_[_loc4_] = _loc19_; _loc4_++; _loc6_[_loc4_] = _loc18_; _loc4_++; _loc6_[_loc4_] = _loc17_; _loc4_++; _loc6_[_loc4_] = _loc20_; _loc4_++; _loc6_[_loc4_] = _loc19_; _loc4_++; _loc6_[_loc4_] = _loc15_; _loc4_++; _loc6_[_loc4_] = _loc19_; _loc4_++; _loc6_[_loc4_] = _loc20_; _loc4_++; _loc6_[_loc4_] = _loc15_; _loc4_++; _loc6_[_loc4_] = _loc20_; _loc4_++; _loc6_[_loc4_] = _loc16_; _loc4_++; _loc6_[_loc4_] = _loc13_; _loc4_++; _loc6_[_loc4_] = _loc16_; _loc4_++; _loc6_[_loc4_] = _loc20_; _loc4_++; _loc6_[_loc4_] = _loc13_; _loc4_++; _loc6_[_loc4_] = _loc20_; _loc4_++; _loc6_[_loc4_] = _loc17_; _loc4_++; _loc6_[_loc4_] = _loc13_; _loc4_++; _loc6_[_loc4_] = _loc14_; _loc4_++; _loc6_[_loc4_] = _loc15_; _loc4_++; _loc6_[_loc4_] = _loc13_; _loc4_++; _loc6_[_loc4_] = _loc15_; _loc4_++; _loc6_[_loc4_] = _loc16_; _loc4_++; _loc1_++; } this.lightVertexBuffer = new VertexBufferResource(_loc5_,5); this.lightIndexBuffer = new IndexBufferResource(_loc6_); var _loc7_:Vector.<uint> = new Vector.<uint>(); var _loc8_:int = 0; var _loc9_:Number = Math.PI * 2; var _loc10_:int = this.tableSize - 1; _loc1_ = 0; while(_loc1_ < this.tableSize) { _loc21_ = (_loc1_ / _loc10_ - 0.5) * 2; _loc2_ = 0; while(_loc2_ < this.tableSize) { _loc22_ = (_loc2_ / _loc10_ - 0.5) * 2; _loc23_ = Math.atan2(_loc21_,_loc22_); if(_loc23_ < 0) { _loc23_ += _loc9_; } _loc7_[_loc8_] = Math.round(255 * _loc23_ / _loc9_); _loc8_++; _loc2_++; } _loc1_++; } this.table = new BitmapTextureResource(new BitmapData(this.tableSize,this.tableSize,false,0),false); this.table.bitmapData.setVector(this.table.bitmapData.rect,_loc7_); _loc7_ = new Vector.<uint>(); _loc8_ = 0; _loc1_ = 0; while(_loc1_ < this.noiseSize) { _loc2_ = 0; while(_loc2_ < this.noiseSize) { _loc24_ = Math.random() * this.noiseAngle; _loc25_ = Math.sin(_loc24_) * 255; _loc26_ = Math.cos(_loc24_) * 255; _loc27_ = (this.noiseRandom + Math.random() * (1 - this.noiseRandom)) * 255; _loc7_[_loc8_] = _loc25_ << 16 | _loc26_ << 8 | _loc27_; _loc8_++; _loc2_++; } _loc1_++; } this.noise = new BitmapTextureResource(new BitmapData(this.noiseSize,this.noiseSize,false,0),false); this.noise.bitmapData.setVector(this.noise.bitmapData.rect,_loc7_); this.depthBuffer = new RenderTargetTextureResource(1,1); this.temporaryBuffer = new RenderTargetTextureResource(1,1); this.lightBuffer = new RenderTargetTextureResource(1,1); } alternativa3d function render(param1:Camera3D, param2:Number, param3:Number, param4:Number, param5:Boolean, param6:Boolean, param7:Number, param8:Vector.<Object3D>, param9:int) : void { var _loc10_:int = 0; var _loc14_:Object3D = null; var _loc15_:VertexBufferResource = null; var _loc16_:IndexBufferResource = null; var _loc17_:int = 0; var _loc18_:TextureMaterial = null; var _loc19_:Mesh = null; var _loc20_:BSP = null; var _loc21_:int = 0; var _loc22_:int = 0; var _loc23_:OmniLight = null; var _loc24_:SpotLight = null; var _loc25_:Number = NaN; var _loc26_:Number = NaN; var _loc27_:TubeLight = null; var _loc11_:Device = param1.device; if(param2 > 2048) { param2 = 2048; } if(param3 > 2048) { param3 = 2048; } if(param4 > 1) { param4 = 1; } param2 = Math.round(param2 * param4); param3 = Math.round(param3 * param4); if(param2 < 1) { param2 = 1; } if(param3 < 1) { param3 = 1; } this.scissor.width = param2; this.scissor.height = param3; var _loc12_:int = 1 << Math.ceil(Math.log(param2) / Math.LN2); var _loc13_:int = 1 << Math.ceil(Math.log(param3) / Math.LN2); if(_loc12_ != this.depthBuffer.width || _loc13_ != this.depthBuffer.height) { this.depthBuffer.dispose(); this.depthBuffer = new RenderTargetTextureResource(_loc12_,_loc13_); this.temporaryBuffer.dispose(); this.temporaryBuffer = new RenderTargetTextureResource(_loc12_,_loc13_); this.lightBuffer.dispose(); this.lightBuffer = new RenderTargetTextureResource(_loc12_,_loc13_); } if(!param5) { this.noise.reset(); this.temporaryBuffer.reset(); this.ssaoVertexBuffer.reset(); this.ssaoIndexBuffer.reset(); } if(!param6) { this.lightBuffer.reset(); this.lightVertexBuffer.reset(); this.lightIndexBuffer.reset(); } if(!param5 && !param6) { this.table.reset(); } this.correctionX = param2 / this.depthBuffer.width; this.correctionY = param3 / this.depthBuffer.height; _loc11_.setRenderToTexture(this.depthBuffer,true); _loc11_.clear(1,0,0.25,1); _loc11_.setScissorRectangle(this.scissor); this.correction[0] = this.correctionX; this.correction[1] = this.correctionY; this.correction[2] = 255 / param1.farClipping; this.correction[4] = 1 - this.correctionX; this.correction[5] = 1 - this.correctionY; this.correction[8] = param1.correctionX; this.correction[9] = param1.correctionY; _loc11_.setProgramConstantsFromVector(Context3DProgramType.VERTEX,3,param1.projection,1,false); _loc11_.setProgramConstantsFromVector(Context3DProgramType.VERTEX,4,this.correction,3,false); if(param5 || param6) { _loc11_.setTextureAt(0,this.table); } _loc10_ = 0; while(_loc10_ < param9) { _loc14_ = param8[_loc10_]; if(_loc14_ is Mesh) { _loc19_ = Mesh(_loc14_); _loc15_ = _loc19_.vertexBuffer; _loc16_ = _loc19_.indexBuffer; _loc17_ = _loc19_.numTriangles; _loc18_ = _loc19_.faceList.material as TextureMaterial; } else if(_loc14_ is BSP) { _loc20_ = BSP(_loc14_); _loc15_ = _loc20_.vertexBuffer; _loc16_ = _loc20_.indexBuffer; _loc17_ = _loc20_.numTriangles; _loc18_ = _loc20_.faces[0].material as TextureMaterial; } if(_loc18_ != null && _loc18_.alphaTestThreshold > 0 && _loc18_.transparent) { _loc11_.setProgram(this.getDepthProgram(param5 || param6,true,param1.view.quality,_loc18_.repeat,_loc18_._mipMapping > 0,false,false)); _loc11_.setVertexBufferAt(2,_loc15_,3,Context3DVertexBufferFormat.FLOAT_2); _loc11_.setTextureAt(1,_loc18_.textureResource); this.alphaTestConst[0] = _loc18_.textureResource.correctionU; this.alphaTestConst[1] = _loc18_.textureResource.correctionV; this.alphaTestConst[3] = _loc18_.alphaTestThreshold; _loc11_.setProgramConstantsFromVector(Context3DProgramType.VERTEX,7,this.alphaTestConst,1); } else { _loc11_.setProgram(this.getDepthProgram(param5 || param6,false)); } _loc11_.setVertexBufferAt(0,_loc15_,0,Context3DVertexBufferFormat.FLOAT_3); _loc11_.setProgramConstantsFromVector(Context3DProgramType.VERTEX,0,_loc14_.transformConst,3,false); _loc11_.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT,0,this.depthFragment,2); if(param5 || param6) { _loc11_.setVertexBufferAt(1,_loc15_,5,Context3DVertexBufferFormat.FLOAT_3); } _loc11_.drawTriangles(_loc16_,0,_loc17_); _loc11_.setTextureAt(1,null); _loc11_.setVertexBufferAt(2,null); _loc10_++; } if(param6) { _loc11_.setRenderToTexture(this.lightBuffer,false); _loc11_.clear(param7,param7,param7,0); _loc11_.setBlendFactors(Context3DBlendFactor.ONE,Context3DBlendFactor.ONE); _loc11_.setTextureAt(0,this.depthBuffer); _loc11_.setVertexBufferAt(0,this.lightVertexBuffer,0,Context3DVertexBufferFormat.FLOAT_3); _loc11_.setVertexBufferAt(1,this.lightVertexBuffer,3,Context3DVertexBufferFormat.FLOAT_2); _loc11_.setProgramConstantsFromVector(Context3DProgramType.VERTEX,0,param1.projection,1,false); _loc11_.setProgramConstantsFromVector(Context3DProgramType.VERTEX,1,this.correction,3,false); this.ssaoFragment[0] = param1.farClipping; this.ssaoFragment[1] = param1.farClipping / 255; this.ssaoFragment[4] = 2 / this.correctionX; this.ssaoFragment[5] = 2 / this.correctionY; this.ssaoFragment[6] = 0; this.ssaoFragment[8] = 1; this.ssaoFragment[9] = 1; this.ssaoFragment[10] = 0.5; this.ssaoFragment[12] = param1.correctionX; this.ssaoFragment[13] = param1.correctionY; this.ssaoFragment[16] = 0.5; this.ssaoFragment[17] = 0.5; _loc11_.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT,0,this.ssaoFragment,7,false); _loc11_.setProgram(this.getOmniProgram()); _loc21_ = 0; _loc22_ = 0; _loc10_ = 0; while(_loc10_ < param1.omniesCount) { _loc23_ = param1.omnies[_loc10_]; this.lightConst[_loc21_] = _loc23_.cmd * param1.correctionX; _loc21_++; this.lightConst[_loc21_] = _loc23_.cmh * param1.correctionY; _loc21_++; this.lightConst[_loc21_] = _loc23_.cml; _loc21_++; this.lightConst[_loc21_] = _loc23_.attenuationEnd; _loc21_++; this.lightConst[_loc21_] = _loc23_.intensity * param1.deferredLightingStrength * (_loc23_.color >> 16 & 255) / 255; _loc21_++; this.lightConst[_loc21_] = _loc23_.intensity * param1.deferredLightingStrength * (_loc23_.color >> 8 & 255) / 255; _loc21_++; this.lightConst[_loc21_] = _loc23_.intensity * param1.deferredLightingStrength * (_loc23_.color & 255) / 255; _loc21_++; this.lightConst[_loc21_] = 1 / (_loc23_.attenuationEnd - _loc23_.attenuationBegin); _loc21_++; _loc22_++; if(_loc22_ == limit2const || _loc10_ == param1.omniesCount - 1) { _loc11_.setProgramConstantsFromVector(Context3DProgramType.VERTEX,4,this.lightConst,_loc22_ * 2,false); _loc11_.drawTriangles(this.lightIndexBuffer,0,_loc22_ * 6 * 2); _loc22_ = 0; _loc21_ = 0; } _loc10_++; } _loc11_.setProgram(this.getSpotProgram()); _loc21_ = 0; _loc22_ = 0; _loc10_ = 0; while(_loc10_ < param1.spotsCount) { _loc24_ = param1.spots[_loc10_]; _loc25_ = Math.cos(_loc24_.hotspot * 0.5); _loc26_ = Math.cos(_loc24_.falloff * 0.5); this.lightConst[_loc21_] = _loc24_.cma; _loc21_++; this.lightConst[_loc21_] = _loc24_.cmb; _loc21_++; this.lightConst[_loc21_] = _loc24_.cmc; _loc21_++; this.lightConst[_loc21_] = _loc24_.cmd; _loc21_++; this.lightConst[_loc21_] = _loc24_.cme; _loc21_++; this.lightConst[_loc21_] = _loc24_.cmf; _loc21_++; this.lightConst[_loc21_] = _loc24_.cmg; _loc21_++; this.lightConst[_loc21_] = _loc24_.cmh; _loc21_++; this.lightConst[_loc21_] = _loc24_.cmi; _loc21_++; this.lightConst[_loc21_] = _loc24_.cmj; _loc21_++; this.lightConst[_loc21_] = _loc24_.cmk; _loc21_++; this.lightConst[_loc21_] = _loc24_.cml; _loc21_++; this.lightConst[_loc21_] = _loc24_.attenuationEnd; _loc21_++; this.lightConst[_loc21_] = 1 / (_loc24_.attenuationEnd - _loc24_.attenuationBegin); _loc21_++; this.lightConst[_loc21_] = _loc26_; _loc21_++; this.lightConst[_loc21_] = 1 / (_loc25_ - _loc26_); _loc21_++; this.lightConst[_loc21_] = _loc24_.intensity * param1.deferredLightingStrength * (_loc24_.color >> 16 & 255) / 255; _loc21_++; this.lightConst[_loc21_] = _loc24_.intensity * param1.deferredLightingStrength * (_loc24_.color >> 8 & 255) / 255; _loc21_++; this.lightConst[_loc21_] = _loc24_.intensity * param1.deferredLightingStrength * (_loc24_.color & 255) / 255; _loc21_++; this.lightConst[_loc21_] = Math.sin(_loc24_.falloff * 0.5) * _loc24_.attenuationEnd; _loc21_++; _loc22_++; if(_loc22_ == limit5const || _loc10_ == param1.spotsCount - 1) { _loc11_.setProgramConstantsFromVector(Context3DProgramType.VERTEX,4,this.lightConst,_loc22_ * 5,false); _loc11_.drawTriangles(this.lightIndexBuffer,0,_loc22_ * 6 * 2); _loc22_ = 0; _loc21_ = 0; } _loc10_++; } _loc11_.setProgram(this.getTubeProgram()); _loc21_ = 0; _loc22_ = 0; _loc10_ = 0; while(_loc10_ < param1.tubesCount) { _loc27_ = param1.tubes[_loc10_]; this.lightConst[_loc21_] = _loc27_.cma; _loc21_++; this.lightConst[_loc21_] = _loc27_.cmb; _loc21_++; this.lightConst[_loc21_] = _loc27_.cmc; _loc21_++; this.lightConst[_loc21_] = _loc27_.cmd; _loc21_++; this.lightConst[_loc21_] = _loc27_.cme; _loc21_++; this.lightConst[_loc21_] = _loc27_.cmf; _loc21_++; this.lightConst[_loc21_] = _loc27_.cmg; _loc21_++; this.lightConst[_loc21_] = _loc27_.cmh; _loc21_++; this.lightConst[_loc21_] = _loc27_.cmi; _loc21_++; this.lightConst[_loc21_] = _loc27_.cmj; _loc21_++; this.lightConst[_loc21_] = _loc27_.cmk; _loc21_++; this.lightConst[_loc21_] = _loc27_.cml; _loc21_++; this.lightConst[_loc21_] = _loc27_.attenuationEnd; _loc21_++; this.lightConst[_loc21_] = 1 / (_loc27_.attenuationEnd - _loc27_.attenuationBegin); _loc21_++; this.lightConst[_loc21_] = _loc27_.length * 0.5 + _loc27_.falloff; _loc21_++; this.lightConst[_loc21_] = 1 / _loc27_.falloff; _loc21_++; this.lightConst[_loc21_] = _loc27_.intensity * param1.deferredLightingStrength * (_loc27_.color >> 16 & 255) / 255; _loc21_++; this.lightConst[_loc21_] = _loc27_.intensity * param1.deferredLightingStrength * (_loc27_.color >> 8 & 255) / 255; _loc21_++; this.lightConst[_loc21_] = _loc27_.intensity * param1.deferredLightingStrength * (_loc27_.color & 255) / 255; _loc21_++; this.lightConst[_loc21_] = _loc27_.length * 0.5; _loc21_++; _loc22_++; if(_loc22_ == limit5const || _loc10_ == param1.tubesCount - 1) { _loc11_.setProgramConstantsFromVector(Context3DProgramType.VERTEX,4,this.lightConst,_loc22_ * 5,false); _loc11_.drawTriangles(this.lightIndexBuffer,0,_loc22_ * 6 * 2); _loc22_ = 0; _loc21_ = 0; } _loc10_++; } _loc11_.setBlendFactors(Context3DBlendFactor.ONE,Context3DBlendFactor.ZERO); } if(param5) { _loc11_.setRenderToTexture(this.temporaryBuffer,false); _loc11_.clear(0,0,0,0); _loc11_.setProgram(this.getSSAOProgram()); _loc11_.setTextureAt(0,this.depthBuffer); _loc11_.setTextureAt(1,this.noise); _loc11_.setVertexBufferAt(0,this.ssaoVertexBuffer,0,Context3DVertexBufferFormat.FLOAT_3); _loc11_.setVertexBufferAt(1,this.ssaoVertexBuffer,3,Context3DVertexBufferFormat.FLOAT_2); this.ssaoVertex[0] = _loc12_ / this.noiseSize; this.ssaoVertex[1] = _loc13_ / this.noiseSize; this.ssaoVertex[4] = 2 / this.correctionX; this.ssaoVertex[5] = 2 / this.correctionY; _loc11_.setProgramConstantsFromVector(Context3DProgramType.VERTEX,0,this.ssaoVertex,3,false); this.ssaoFragment[0] = param1.farClipping; this.ssaoFragment[1] = param1.farClipping / 255; this.ssaoFragment[4] = 2 / this.correctionX; this.ssaoFragment[5] = 2 / this.correctionY; this.ssaoFragment[6] = param1.ssaoRadius; this.ssaoFragment[8] = 1; this.ssaoFragment[9] = 1; this.ssaoFragment[10] = this.bias; this.ssaoFragment[11] = this.intensity * 1 / this.samples; this.ssaoFragment[12] = param1.correctionX; this.ssaoFragment[13] = param1.correctionY; this.ssaoFragment[15] = 1 / param1.ssaoRange; this.ssaoFragment[16] = Math.cos(this.noiseAngle); this.ssaoFragment[17] = Math.sin(this.noiseAngle); this.ssaoFragment[20] = -Math.sin(this.noiseAngle); this.ssaoFragment[21] = Math.cos(this.noiseAngle); this.ssaoFragment[24] = this.correctionX - 1 / _loc12_; this.ssaoFragment[25] = this.correctionY - 1 / _loc13_; _loc11_.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT,0,this.ssaoFragment,7,false); _loc11_.drawTriangles(this.ssaoIndexBuffer,0,2); _loc11_.setTextureAt(1,null); _loc11_.setRenderToTexture(this.depthBuffer,false); _loc11_.clear(0,0,0,0); _loc11_.setProgram(this.getBlurProgram()); _loc11_.setTextureAt(0,this.temporaryBuffer); this.blurFragment[0] = 1 / _loc12_; this.blurFragment[1] = 1 / _loc13_; this.blurFragment[3] = 1 / this.blurSamples; this.blurFragment[4] = this.correctionX - 1 / _loc12_; this.blurFragment[5] = this.correctionY - 1 / _loc13_; _loc11_.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT,0,this.blurFragment,2,false); _loc11_.drawTriangles(this.ssaoIndexBuffer,0,2); } _loc11_.setVertexBufferAt(1,null); _loc11_.setTextureAt(0,null); _loc11_.setScissorRectangle(null); } alternativa3d function resetResources() : void { this.noise.reset(); this.table.reset(); this.depthBuffer.reset(); this.temporaryBuffer.reset(); this.lightBuffer.reset(); this.ssaoVertexBuffer.reset(); this.ssaoIndexBuffer.reset(); this.lightVertexBuffer.reset(); this.lightIndexBuffer.reset(); } private function getDepthProgram(param1:Boolean, param2:Boolean, param3:Boolean = false, param4:Boolean = false, param5:Boolean = false, param6:Boolean = false, param7:Boolean = false) : ProgramResource { var _loc10_:ByteArray = null; var _loc11_:ByteArray = null; var _loc8_:int = int(param1) | int(param2) << 1 | int(param3) << 2 | int(param4) << 3 | int(param5) << 4 | int(param6) << 5 | int(param7) << 6; var _loc9_:ProgramResource = this.depthPrograms[_loc8_]; if(_loc9_ == null) { _loc10_ = new DepthRendererDepthVertexShader(param1,param2).agalcode; _loc11_ = new DepthRendererDepthFragmentShader(param1,param2,param3,param4,param5).agalcode; _loc9_ = new ProgramResource(_loc10_,_loc11_); this.depthPrograms[_loc8_] = _loc9_; } return _loc9_; } private function getSSAOProgram() : ProgramResource { var _loc2_:ByteArray = null; var _loc3_:ByteArray = null; var _loc1_:ProgramResource = this.ssaoProgram; if(_loc1_ == null) { _loc2_ = new DepthRendererSSAOVertexShader().agalcode; _loc3_ = new DepthRendererSSAOFragmentShader(this.samples).agalcode; _loc1_ = new ProgramResource(_loc2_,_loc3_); this.ssaoProgram = _loc1_; } return _loc1_; } private function getBlurProgram() : ProgramResource { var _loc2_:ByteArray = null; var _loc3_:ByteArray = null; var _loc1_:ProgramResource = this.blurProgram; if(_loc1_ == null) { _loc2_ = new DepthRendererBlurVertexShader().agalcode; _loc3_ = new DepthRendererBlurFragmentShader().agalcode; _loc1_ = new ProgramResource(_loc2_,_loc3_); this.blurProgram = _loc1_; } return _loc1_; } private function getOmniProgram() : ProgramResource { var _loc2_:ByteArray = null; var _loc3_:ByteArray = null; var _loc1_:ProgramResource = this.omniProgram; if(_loc1_ == null) { _loc2_ = new DepthRendererLightVertexShader(0).agalcode; _loc3_ = new DepthRendererLightFragmentShader(0).agalcode; _loc1_ = new ProgramResource(_loc2_,_loc3_); this.omniProgram = _loc1_; } return _loc1_; } private function getSpotProgram() : ProgramResource { var _loc2_:ByteArray = null; var _loc3_:ByteArray = null; var _loc1_:ProgramResource = this.spotProgram; if(_loc1_ == null) { _loc2_ = new DepthRendererLightVertexShader(1).agalcode; _loc3_ = new DepthRendererLightFragmentShader(1).agalcode; _loc1_ = new ProgramResource(_loc2_,_loc3_); this.spotProgram = _loc1_; } return _loc1_; } private function getTubeProgram() : ProgramResource { var _loc2_:ByteArray = null; var _loc3_:ByteArray = null; var _loc1_:ProgramResource = this.tubeProgram; if(_loc1_ == null) { _loc2_ = new DepthRendererLightVertexShader(2).agalcode; _loc3_ = new DepthRendererLightFragmentShader(2).agalcode; _loc1_ = new ProgramResource(_loc2_,_loc3_); this.tubeProgram = _loc1_; } return _loc1_; } } }
package controls.timer { import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; public class CountDownTimerOnCompleteBeforeWithContext implements CountDownTimerOnCompleteBefore { private var contextObject:IGameObject; private var listener:CountDownTimerOnCompleteBefore; public function CountDownTimerOnCompleteBeforeWithContext(param1:IGameObject, param2:CountDownTimerOnCompleteBefore) { super(); this.contextObject = param1; this.listener = param2; } public function onCompleteBefore(param1:CountDownTimer, param2:Boolean) : void { Model.object = this.contextObject; this.listener.onCompleteBefore(param1,param2); Model.popObject(); } } }
package alternativa.tanks.models.tank { import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; public class DestroyTankPartAdapt implements DestroyTankPart { private var object:IGameObject; private var impl:DestroyTankPart; public function DestroyTankPartAdapt(param1:IGameObject, param2:DestroyTankPart) { super(); this.object = param1; this.impl = param2; } public function destroyTankPart() : void { try { Model.object = this.object; this.impl.destroyTankPart(); } finally { Model.popObject(); } } } }
package alternativa.debug { import mx.core.BitmapAsset; [ExcludeClass] public class ErrorWindow_backBitmap extends BitmapAsset { public function ErrorWindow_backBitmap() { super(); } } }
package alternativa.tanks.models.weapon.machinegun.sfx { import alternativa.tanks.battle.BattleService; import flash.utils.Dictionary; public class ParticleSystem { [Inject] public static var battleService:BattleService; private var particles:Dictionary = new Dictionary(); private var particleClass:Class; private var emit:Boolean; private var emitInterval:Number = 0; private var time:Number = 0; private var count:int; private var maxCount:int; public function ParticleSystem(param1:Class, param2:Number, param3:int) { super(); this.particleClass = param1; this.emitInterval = param2; this.maxCount = param3; } public function start() : void { this.emit = true; } public function stop() : void { this.emit = false; } public function update(param1:Number) : Boolean { var local2:* = undefined; var local3:Particle = null; if(this.emit) { this.time += param1; if(this.time >= this.emitInterval) { this.time = 0; if(this.count < this.maxCount) { this.createParticle(); } } } for(local2 in this.particles) { local3 = local2; this.onUpdateParticle(local3,param1); if(!local3.alive) { this.deleteParticle(local3); } } return this.emit || this.count > 0; } public function clear() : void { var local1:* = undefined; var local2:Particle = null; for(local1 in this.particles) { local2 = local1; this.deleteParticle(local2); } this.stop(); } protected function onCreateParticle(param1:Particle) : void { } protected function onUpdateParticle(param1:Particle, param2:Number) : void { } protected function onDeleteParticle(param1:Particle) : void { } private function createParticle() : void { var local1:Particle = Particle(battleService.getObjectPool().getObject(this.particleClass)); local1.alive = true; this.onCreateParticle(local1); this.particles[local1] = true; ++this.count; } private function deleteParticle(param1:Particle) : void { this.onDeleteParticle(param1); delete this.particles[param1]; param1.recycle(); --this.count; } } }
package _codec.projects.tanks.client.commons.types { import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import projects.tanks.client.commons.types.ShopCategoryEnum; public class CodecShopCategoryEnum implements ICodec { public function CodecShopCategoryEnum() { super(); } public function init(param1:IProtocol) : void { } public function decode(param1:ProtocolBuffer) : Object { var local2:ShopCategoryEnum = null; var local3:int = int(param1.reader.readInt()); switch(local3) { case 0: local2 = ShopCategoryEnum.CRYSTALS; break; case 1: local2 = ShopCategoryEnum.COINS; break; case 2: local2 = ShopCategoryEnum.PREMIUM; break; case 3: local2 = ShopCategoryEnum.GOLD_BOXES; break; case 4: local2 = ShopCategoryEnum.PAINTS; break; case 5: local2 = ShopCategoryEnum.KITS; break; case 6: local2 = ShopCategoryEnum.OTHERS; break; case 7: local2 = ShopCategoryEnum.LOOT_BOXES; break; case 8: local2 = ShopCategoryEnum.NO_CATEGORY; } return local2; } public function encode(param1:ProtocolBuffer, param2:Object) : void { if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:int = int(param2.value); param1.writer.writeInt(local3); } } }
package alternativa.tanks.model.bonus.showing.items { import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; import projects.tanks.client.panel.model.bonus.showing.items.BonusItemCC; public class BonusItemAdapt implements BonusItem { private var object:IGameObject; private var impl:BonusItem; public function BonusItemAdapt(param1:IGameObject, param2:BonusItem) { super(); this.object = param1; this.impl = param2; } public function getItem() : BonusItemCC { var result:BonusItemCC = null; try { Model.object = this.object; result = this.impl.getItem(); } finally { Model.popObject(); } return result; } } }
package _codec.projects.tanks.client.panel.model.referrals { import alternativa.osgi.OSGi; import alternativa.osgi.service.clientlog.IClientLog; import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.TypeCodecInfo; import projects.tanks.client.panel.model.referrals.ReferralsModelCC; public class CodecReferralsModelCC implements ICodec { public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog)); private var codec_inviteLink:ICodec; public function CodecReferralsModelCC() { super(); } public function init(param1:IProtocol) : void { this.codec_inviteLink = param1.getCodec(new TypeCodecInfo(String,false)); } public function decode(param1:ProtocolBuffer) : Object { var local2:ReferralsModelCC = new ReferralsModelCC(); local2.inviteLink = this.codec_inviteLink.decode(param1) as String; return local2; } public function encode(param1:ProtocolBuffer, param2:Object) : void { if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:ReferralsModelCC = ReferralsModelCC(param2); this.codec_inviteLink.encode(param1,local3.inviteLink); } } }
package projects.tanks.client.panel.model.profile.usersettings { public class ClientStoredSettings { private var _showDamageEnabled:Boolean; public function ClientStoredSettings(param1:Boolean = false) { super(); this._showDamageEnabled = param1; } public function get showDamageEnabled() : Boolean { return this._showDamageEnabled; } public function set showDamageEnabled(param1:Boolean) : void { this._showDamageEnabled = param1; } public function toString() : String { var local1:String = "ClientStoredSettings ["; local1 += "showDamageEnabled = " + this.showDamageEnabled + " "; return local1 + "]"; } } }
package projects.tanks.client.battlefield.models.battle.pointbased { import projects.tanks.client.battlefield.models.battle.pointbased.flag.ClientFlag; public class PointBasedBattleCC { private var _flags:Vector.<ClientFlag>; private var _teamPoints:Vector.<ClientTeamPoint>; public function PointBasedBattleCC(param1:Vector.<ClientFlag> = null, param2:Vector.<ClientTeamPoint> = null) { super(); this._flags = param1; this._teamPoints = param2; } public function get flags() : Vector.<ClientFlag> { return this._flags; } public function set flags(param1:Vector.<ClientFlag>) : void { this._flags = param1; } public function get teamPoints() : Vector.<ClientTeamPoint> { return this._teamPoints; } public function set teamPoints(param1:Vector.<ClientTeamPoint>) : void { this._teamPoints = param1; } public function toString() : String { var local1:String = "PointBasedBattleCC ["; local1 += "flags = " + this.flags + " "; local1 += "teamPoints = " + this.teamPoints + " "; return local1 + "]"; } } }
package alternativa.tanks.models.battle.meteor.nuclear { import alternativa.engine3d.core.Vertex; import alternativa.engine3d.materials.TextureMaterial; import alternativa.engine3d.objects.Mesh; import alternativa.math.Vector3; import alternativa.tanks.battle.scene3d.scene3dcontainer.Scene3DContainer; import alternativa.tanks.camera.GameCamera; import alternativa.tanks.sfx.GraphicEffect; import alternativa.tanks.utils.objectpool.Pool; import alternativa.tanks.utils.objectpool.PooledObject; import flash.display.BlendMode; public class NuclearLightWaveEffect extends PooledObject implements GraphicEffect { private var container:Scene3DContainer = null; private var wave:Mesh = new Mesh(); private var time:Number = 0; private var epicenter:Vector3 = new Vector3(); public function NuclearLightWaveEffect(param1:Pool) { super(param1); } public function init(param1:Vector3, param2:TextureMaterial) : void { this.epicenter.copy(param1); var local3:Number = 2000; var local4:Vertex = this.wave.addVertex(-local3,local3,0,0,0); var local5:Vertex = this.wave.addVertex(-local3,-local3,0,0,1); var local6:Vertex = this.wave.addVertex(local3,-local3,0,1,1); var local7:Vertex = this.wave.addVertex(local3,local3,0,1,0); this.wave.addQuadFace(local4,local5,local6,local7,param2); this.wave.addQuadFace(local4,local7,local6,local5,param2); this.wave.calculateFacesNormals(); this.wave.calculateBounds(); this.wave.useLight = false; this.wave.useShadowMap = false; this.wave.shadowMapAlphaThreshold = 2; this.wave.depthMapAlphaThreshold = 2; this.wave.blendMode = BlendMode.ADD; this.wave.softAttenuation = 80; this.wave.scaleX = 1; this.wave.scaleY = 1; this.wave.scaleZ = 1; this.time = 0; } public function addedToScene(param1:Scene3DContainer) : void { this.container = param1; param1.addChild(this.wave); } public function play(param1:int, param2:GameCamera) : Boolean { var local3:Number = param1 / 1000; this.time += local3; this.wave.x = this.epicenter.x; this.wave.y = this.epicenter.y; this.wave.z = this.epicenter.z + 80; var local4:Number = NuclearBangEffect.KEY1 / 3; var local5:Number = 10 / 60; var local6:Number = 20 / 60; if(this.time <= local4) { this.wave.alpha = this.time / local5; this.wave.visible = true; } else if(this.time <= local6) { this.wave.alpha = 1 - (this.time - local5) / (local6 - local5); this.wave.visible = true; } else { this.wave.visible = false; } var local7:Number = local3 * 6; this.wave.scaleX += local7; this.wave.scaleY += local7; return this.wave.visible; } public function destroy() : void { if(this.container != null) { this.container.removeChild(this.wave); this.container = null; } this.wave.setMaterialToAllFaces(null); recycle(); } public function kill() : void { this.destroy(); } } }
package controls.lifeindicator { public class LineLife extends HorizontalBar { [Embed(source="850.png")] private static const bitmapLeft:Class; [Embed(source="1150.png")] private static const bitmapCenter:Class; [Embed(source="909.png")] private static const bitmapRight:Class; public function LineLife() { super(new bitmapLeft().bitmapData,new bitmapCenter().bitmapData,new bitmapRight().bitmapData); } } }
package alternativa.init { import alternativa.console.Console; import alternativa.console.IConsole; import alternativa.debug.Debug; import alternativa.debug.dump.ClassDumper; import alternativa.debug.dump.ModelDumper; import alternativa.debug.dump.ObjectDumper; import alternativa.debug.dump.ResourceDumper; import alternativa.debug.dump.SpaceDumper; import alternativa.model.general.dispatcher.DispatcherModel; import alternativa.network.AlternativaNetworkClient; import alternativa.network.CommandSocket; import alternativa.network.command.ControlCommand; import alternativa.network.command.SpaceCommand; import alternativa.network.handler.ControlCommandHandler; import alternativa.osgi.bundle.IBundleActivator; import alternativa.osgi.service.alert.IAlertService; import alternativa.osgi.service.console.IConsoleService; import alternativa.osgi.service.debug.IDebugService; import alternativa.osgi.service.dump.IDumpService; import alternativa.osgi.service.loader.ILoaderService; import alternativa.osgi.service.loader.LoadingProgress; import alternativa.osgi.service.log.ILogService; import alternativa.osgi.service.log.LogLevel; import alternativa.osgi.service.mainContainer.IMainContainerService; import alternativa.osgi.service.network.INetworkService; import alternativa.osgi.service.storage.IStorageService; import alternativa.protocol.Protocol; import alternativa.protocol.codec.ClassCodec; import alternativa.protocol.codec.ControlRootCodec; import alternativa.protocol.codec.ResourceCodec; import alternativa.protocol.codec.SpaceRootCodec; import alternativa.protocol.factory.CodecFactory; import alternativa.protocol.factory.ICodecFactory; import alternativa.register.ClassInfo; import alternativa.register.ClassRegister; import alternativa.register.ModelsRegister; import alternativa.register.ResourceRegister; import alternativa.register.SpaceRegister; import alternativa.resource.ResourceInfo; import alternativa.resource.ResourceType; import alternativa.resource.ResourceWrapper; import alternativa.resource.factory.ImageResourceFactory; import alternativa.resource.factory.LibraryResourceFactory; import alternativa.resource.factory.MovieClipResourceFactory; import alternativa.resource.factory.SoundResourceFactory; import alternativa.service.AddressService; import alternativa.service.DummyLogService; import alternativa.service.IAddressService; import alternativa.service.IClassService; import alternativa.service.IModelService; import alternativa.service.IProtocolService; import alternativa.service.IResourceService; import alternativa.service.ISpaceService; import alternativa.service.Logger; import alternativa.service.ProtocolService; import alternativa.service.ServerLogService; import alternativa.tanks.loader.ILoaderWindowService; import alternativa.types.Long; import alternativa.types.LongFactory; import flash.display.DisplayObjectContainer; import flash.display.Stage; import flash.events.Event; import flash.net.SharedObject; import swfaddress.SWFAddressEvent; public class Main implements IBundleActivator { public static var stage:Stage; public static var mainContainer:DisplayObjectContainer; public static var backgroundLayer:DisplayObjectContainer; public static var contentLayer:DisplayObjectContainer; public static var contentUILayer:DisplayObjectContainer; public static var systemLayer:DisplayObjectContainer; public static var systemUILayer:DisplayObjectContainer; public static var dialogsLayer:DisplayObjectContainer; public static var noticesLayer:DisplayObjectContainer; public static var cursorLayer:DisplayObjectContainer; public static var controlHandler:ControlCommandHandler; public static var codecFactory:ICodecFactory; public static var loadingProgress:LoadingProgress; public static var debug:Debug; public static var osgi:OSGi; public static var currentPortIndex:int; public static var logger:ILogService; private static const SHOW_LOG_MSGS:String = "show_log_msgs"; private static const SHOW_ALL_LOG_MSGS:String = "show_all_log_msgs"; private static var controlSocket:CommandSocket; private static var networkClient:AlternativaNetworkClient; public function Main() { super(); } public static function onMainLibrariesLoaded(loadedLibraries:Array) : void { var libraryWrapper:ResourceWrapper = null; var connectedPort:int = 0; var index:int = 0; var loadingProgressId:int = 0; var loaderService:ILoaderService = null; for(var i:int = 0; i < loadedLibraries.length; i++) { libraryWrapper = new ResourceWrapper(loadedLibraries[i]); IResourceService(Main.osgi.getService(IResourceService)).registerResource(libraryWrapper); } currentPortIndex = 0; var ports:Array = INetworkService(Main.osgi.getService(INetworkService)).ports; var storage:SharedObject = IStorageService(Main.osgi.getService(IStorageService)).getStorage(); if(storage.data.port != null) { connectedPort = storage.data.port; index = ports.indexOf(connectedPort); if(index != -1) { ports.splice(index,1); ports.unshift(connectedPort); } } try { loadingProgressId = 0; loaderService = Main.osgi.getService(ILoaderService) as ILoaderService; loaderService.loadingProgress.startProgress(loadingProgressId); loaderService.loadingProgress.setStatus(loadingProgressId,"Connection to port " + ports[currentPortIndex]); controlSocket = networkClient.newConnection(ports[currentPortIndex],Main.controlHandler); } catch(e:Error) { Main.tryNextPort(); } var showLogMessages:Boolean = stage.loaderInfo.parameters[SHOW_LOG_MSGS] != null; var showOnlyErrors:Boolean = stage.loaderInfo.parameters[SHOW_ALL_LOG_MSGS] == null; if(osgi.getService(IDebugService) != null) { logger = new ServerLogService(controlSocket,stage,!!showOnlyErrors ? [LogLevel.LOG_ERROR] : null); } else if(showLogMessages || !showOnlyErrors) { logger = new ServerLogService(controlSocket,stage,!!showOnlyErrors ? [LogLevel.LOG_ERROR] : null); } else { logger = new DummyLogService(); } } public static function tryNextPort() : void { var loaderWindow:ILoaderWindowService = null; var alertService:IAlertService = null; writeVarsToConsoleChannel("NETWORK","tryNextPort"); currentPortIndex += 1; writeVarsToConsoleChannel("NETWORK"," currentPortIndex: %1",currentPortIndex); var server:String = INetworkService(Main.osgi.getService(INetworkService)).server; var ports:Array = INetworkService(Main.osgi.getService(INetworkService)).ports; writeVarsToConsoleChannel("NETWORK"," currentPort: %1",ports[currentPortIndex]); var loaderService:ILoaderService = Main.osgi.getService(ILoaderService) as ILoaderService; var loadingProgressId:int = 0; loaderService.loadingProgress.setProgress(loadingProgressId,currentPortIndex * (1 / ports.length)); if(ports[currentPortIndex] != null) { try { writeVarsToConsoleChannel("NETWORK"," newConnection to port %1",ports[currentPortIndex]); loaderService.loadingProgress.setStatus(loadingProgressId,"Connection to port " + ports[currentPortIndex]); controlSocket = networkClient.newConnection(ports[currentPortIndex],Main.controlHandler); } catch(e:Error) { Main.tryNextPort(); } } else { loaderWindow = Main.osgi.getService(ILoaderWindowService) as ILoaderWindowService; loaderWindow.hideLoaderWindow(); alertService = Main.osgi.getService(IAlertService) as IAlertService; alertService.showAlert("Connection to server " + server + " failed"); } } public static function writeToConsole(message:String, color:uint = 0) : void { } public static function writeVarsToConsole(message:String, ... vars) : void { for(var i:int = 0; i < vars.length; i++) { message = message.replace("%" + (i + 1),vars[i]); } } public static function writeVarsToConsoleChannel(channel:String, message:String, ... vars) : void { for(var i:int = 0; i < vars.length; i++) { message = message.replace("%" + (i + 1),vars[i]); } Logger.log(1,message); } public static function hideConsole() : void { IConsoleService(Main.osgi.getService(IConsoleService)).hideConsole(); } public static function showConsole() : void { IConsoleService(Main.osgi.getService(IConsoleService)).showConsole(); } private static function onAddressChange(e:Event) : void { } public function start(_osgi:OSGi) : void { osgi = _osgi; osgi.registerService(IClassService,new ClassRegister()); osgi.registerService(ISpaceService,new SpaceRegister()); var modelsRegister:IModelService = new ModelsRegister(); osgi.registerService(IModelService,modelsRegister); var resourceRegister:IResourceService = new ResourceRegister(); osgi.registerService(IResourceService,resourceRegister); var addressService:IAddressService = new AddressService(); osgi.registerService(IAddressService,addressService); if(addressService.getBaseURL() != "" && addressService.getBaseURL() != "undefined") { addressService.addEventListener(SWFAddressEvent.CHANGE,onAddressChange); } else { osgi.unregisterService(IAddressService); } var dumpService:IDumpService = IDumpService(osgi.getService(IDumpService)); dumpService.registerDumper(new SpaceDumper()); dumpService.registerDumper(new ObjectDumper()); dumpService.registerDumper(new ClassDumper()); dumpService.registerDumper(new ResourceDumper()); dumpService.registerDumper(new ModelDumper()); codecFactory = new CodecFactory(); osgi.registerService(IProtocolService,new ProtocolService(codecFactory)); codecFactory.registerCodec(ControlCommand,new ControlRootCodec(codecFactory)); codecFactory.registerCodec(SpaceCommand,new SpaceRootCodec(codecFactory)); codecFactory.registerCodec(ResourceInfo,new ResourceCodec(codecFactory)); codecFactory.registerCodec(ClassInfo,new ClassCodec(codecFactory)); var controlProtocol:Protocol = new Protocol(codecFactory,ControlCommand); var server:String = INetworkService(osgi.getService(INetworkService)).server; var resourcesURL:String = INetworkService(osgi.getService(INetworkService)).resourcesPath; networkClient = new AlternativaNetworkClient(server,controlProtocol); controlHandler = new ControlCommandHandler(server); var long0:Long = LongFactory.getLong(0,0); var long1:Long = LongFactory.getLong(0,1); var long2:Long = LongFactory.getLong(0,2); modelsRegister.register("0","0"); modelsRegister.register("0","1"); modelsRegister.register("0","2"); modelsRegister.add(new DispatcherModel()); stage = IMainContainerService(osgi.getService(IMainContainerService)).stage; mainContainer = IMainContainerService(osgi.getService(IMainContainerService)).mainContainer; backgroundLayer = IMainContainerService(osgi.getService(IMainContainerService)).backgroundLayer; contentLayer = IMainContainerService(osgi.getService(IMainContainerService)).contentLayer; contentUILayer = IMainContainerService(osgi.getService(IMainContainerService)).contentUILayer; systemLayer = IMainContainerService(osgi.getService(IMainContainerService)).systemLayer; systemUILayer = IMainContainerService(osgi.getService(IMainContainerService)).systemUILayer; dialogsLayer = IMainContainerService(osgi.getService(IMainContainerService)).dialogsLayer; noticesLayer = IMainContainerService(osgi.getService(IMainContainerService)).noticesLayer; cursorLayer = IMainContainerService(osgi.getService(IMainContainerService)).cursorLayer; resourceRegister.registerResourceFactory(new LibraryResourceFactory(),ResourceType.LIBRARY); resourceRegister.registerResourceFactory(new SoundResourceFactory(),ResourceType.MP3); resourceRegister.registerResourceFactory(new MovieClipResourceFactory(),ResourceType.MOVIE_CLIP); resourceRegister.registerResourceFactory(new ImageResourceFactory(),ResourceType.IMAGE); loadingProgress = ILoaderService(osgi.getService(ILoaderService)).loadingProgress; debug = new Debug(); osgi.registerService(IAlertService,debug); var debugService:Object = osgi.getService(IDebugService); var console:Console = new Console(stage,debugService != null); osgi.registerService(IConsole,console); if(logger == null) { logger = new Logger(); } osgi.registerService(ILogService,logger); } public function stop(osgi:OSGi) : void { } } }
package projects.tanks.clients.flash.commonsflash { import alternativa.osgi.OSGi; import alternativa.osgi.bundle.IBundleActivator; import alternativa.osgi.service.display.IDisplay; import alternativa.osgi.service.launcherparams.ILauncherParams; import alternativa.osgi.service.locale.ILocaleService; import alternativa.osgi.service.logging.LogService; import alternativa.tanks.loader.ILoaderWindowService; import alternativa.tanks.loader.IModalLoaderService; import alternativa.tanks.ymservice.YandexMetricaService; import platform.client.fp10.core.registry.ModelRegistry; import platform.client.fp10.core.registry.ResourceRegistry; import platform.clients.fp10.libraries.alternativapartners.service.IPartnerService; import projects.tanks.clients.flash.commons.models.alert.AlertModel; import projects.tanks.clients.flash.commons.models.battlelinkactivator.BattleLinkActivatorModel; import projects.tanks.clients.flash.commons.models.captcha.IServerCaptcha; import projects.tanks.clients.flash.commons.models.captcha.IServerCaptchaAdapt; import projects.tanks.clients.flash.commons.models.captcha.IServerCaptchaEvents; import projects.tanks.clients.flash.commons.models.captcha.ServerCaptchaModel; import projects.tanks.clients.flash.commons.models.challenge.ChallengeInfoService; import projects.tanks.clients.flash.commons.models.challenge.ChallengeTimeModel; import projects.tanks.clients.flash.commons.models.coloring.ColoringModel; import projects.tanks.clients.flash.commons.models.coloring.IColoring; import projects.tanks.clients.flash.commons.models.coloring.IColoringAdapt; import projects.tanks.clients.flash.commons.models.coloring.IColoringEvents; import projects.tanks.clients.flash.commons.models.detach.Detach; import projects.tanks.clients.flash.commons.models.detach.DetachAdapt; import projects.tanks.clients.flash.commons.models.detach.DetachEvents; import projects.tanks.clients.flash.commons.models.detach.DetachModel; import projects.tanks.clients.flash.commons.models.externalauth.ExternalAuthApi; import projects.tanks.clients.flash.commons.models.externalauth.ExternalAuthApiAdapt; import projects.tanks.clients.flash.commons.models.externalauth.ExternalAuthApiEvents; import projects.tanks.clients.flash.commons.models.externalauth.ExternalAuthApiModel; import projects.tanks.clients.flash.commons.models.gpu.GPUDetectorModel; import projects.tanks.clients.flash.commons.models.layout.ILobbyLayout; import projects.tanks.clients.flash.commons.models.layout.ILobbyLayoutAdapt; import projects.tanks.clients.flash.commons.models.layout.ILobbyLayoutEvents; import projects.tanks.clients.flash.commons.models.layout.LobbyLayoutModel; import projects.tanks.clients.flash.commons.models.layout.notify.ILobbyLayoutNotify; import projects.tanks.clients.flash.commons.models.layout.notify.ILobbyLayoutNotifyAdapt; import projects.tanks.clients.flash.commons.models.layout.notify.ILobbyLayoutNotifyEvents; import projects.tanks.clients.flash.commons.models.layout.notify.LobbyLayoutNotifyModel; import projects.tanks.clients.flash.commons.models.moveusertoserver.MoveUserToServerModel; import projects.tanks.clients.flash.commons.models.runtime.DataOwner; import projects.tanks.clients.flash.commons.models.runtime.DataOwnerAdapt; import projects.tanks.clients.flash.commons.models.runtime.DataOwnerEvents; import projects.tanks.clients.flash.commons.models.runtime.DataOwnerModel; import projects.tanks.clients.flash.commons.models.serverhalt.ServerHaltModel; import projects.tanks.clients.flash.commons.services.autobattleenter.AutomaticEnterExitService; import projects.tanks.clients.flash.commons.services.datetime.DateFormatter; import projects.tanks.clients.flash.commons.services.layout.LobbyLayoutService; import projects.tanks.clients.flash.commons.services.nameutils.SocialNetworkNameUtils; import projects.tanks.clients.flash.commons.services.notification.Notification; import projects.tanks.clients.flash.commons.services.notification.sound.INotificationSoundService; import projects.tanks.clients.flash.commons.services.payment.PaymentDisplayService; import projects.tanks.clients.flash.commons.services.serverhalt.IServerHaltService; import projects.tanks.clients.flash.commons.services.stagequality.StageQualityService; import projects.tanks.clients.flash.commons.services.timeunit.TimeUnitService; import projects.tanks.clients.fp10.libraries.tanksservices.service.address.TanksAddressService; import projects.tanks.clients.fp10.libraries.tanksservices.service.alertservices.IAlertService; import projects.tanks.clients.fp10.libraries.tanksservices.service.battle.IBattleInfoService; import projects.tanks.clients.fp10.libraries.tanksservices.service.battle.activator.IBattleLinkActivatorService; import projects.tanks.clients.fp10.libraries.tanksservices.service.dialogwindowdispatcher.IDialogWindowsDispatcherService; import projects.tanks.clients.fp10.libraries.tanksservices.service.layout.ILobbyLayoutService; import projects.tanks.clients.fp10.libraries.tanksservices.service.logging.gamescreen.UserChangeGameScreenService; import projects.tanks.clients.fp10.libraries.tanksservices.service.storage.IStorageService; import projects.tanks.clients.fp10.libraries.tanksservices.service.user.IUserInfoService; import projects.tanks.clients.fp10.libraries.tanksservices.service.userproperties.IUserPropertiesService; public class Activator implements IBundleActivator { public static var osgi:OSGi; public function Activator() { super(); } public function start(param1:OSGi) : void { var modelRegister:ModelRegistry; var modelRegisterAdapt:ModelRegistry; var _osgi:OSGi = param1; osgi = _osgi; osgi.injectService(IAlertService,function(param1:Object):void { AlertModel.alertService = IAlertService(param1); },function():IAlertService { return AlertModel.alertService; }); osgi.injectService(ILocaleService,function(param1:Object):void { AlertModel.localeService = ILocaleService(param1); },function():ILocaleService { return AlertModel.localeService; }); osgi.injectService(IAlertService,function(param1:Object):void { BattleLinkActivatorModel.alertService = IAlertService(param1); },function():IAlertService { return BattleLinkActivatorModel.alertService; }); osgi.injectService(IBattleLinkActivatorService,function(param1:Object):void { BattleLinkActivatorModel.battleLinkActivatorService = IBattleLinkActivatorService(param1); },function():IBattleLinkActivatorService { return BattleLinkActivatorModel.battleLinkActivatorService; }); osgi.injectService(ILobbyLayoutService,function(param1:Object):void { BattleLinkActivatorModel.lobbyLayoutService = ILobbyLayoutService(param1); },function():ILobbyLayoutService { return BattleLinkActivatorModel.lobbyLayoutService; }); osgi.injectService(ILocaleService,function(param1:Object):void { BattleLinkActivatorModel.localeService = ILocaleService(param1); },function():ILocaleService { return BattleLinkActivatorModel.localeService; }); osgi.injectService(IStorageService,function(param1:Object):void { BattleLinkActivatorModel.storageService = IStorageService(param1); },function():IStorageService { return BattleLinkActivatorModel.storageService; }); osgi.injectService(IUserPropertiesService,function(param1:Object):void { BattleLinkActivatorModel.userPropertyService = IUserPropertiesService(param1); },function():IUserPropertiesService { return BattleLinkActivatorModel.userPropertyService; }); osgi.injectService(ChallengeInfoService,function(param1:Object):void { ChallengeTimeModel.challengesService = ChallengeInfoService(param1); },function():ChallengeInfoService { return ChallengeTimeModel.challengesService; }); osgi.injectService(ResourceRegistry,function(param1:Object):void { ColoringModel.resourceRegistry = ResourceRegistry(param1); },function():ResourceRegistry { return ColoringModel.resourceRegistry; }); osgi.injectService(IDisplay,function(param1:Object):void { GPUDetectorModel.display = IDisplay(param1); },function():IDisplay { return GPUDetectorModel.display; }); osgi.injectService(ILauncherParams,function(param1:Object):void { GPUDetectorModel.launcherParams = ILauncherParams(param1); },function():ILauncherParams { return GPUDetectorModel.launcherParams; }); osgi.injectService(IBattleInfoService,function(param1:Object):void { LobbyLayoutModel.battleInfoSerivce = IBattleInfoService(param1); },function():IBattleInfoService { return LobbyLayoutModel.battleInfoSerivce; }); osgi.injectService(ILobbyLayoutService,function(param1:Object):void { LobbyLayoutModel.lobbyLayoutService = ILobbyLayoutService(param1); },function():ILobbyLayoutService { return LobbyLayoutModel.lobbyLayoutService; }); osgi.injectService(IStorageService,function(param1:Object):void { LobbyLayoutModel.storageService = IStorageService(param1); },function():IStorageService { return LobbyLayoutModel.storageService; }); osgi.injectService(TanksAddressService,function(param1:Object):void { LobbyLayoutModel.tanksAddressService = TanksAddressService(param1); },function():TanksAddressService { return LobbyLayoutModel.tanksAddressService; }); osgi.injectService(ILoaderWindowService,function(param1:Object):void { LobbyLayoutNotifyModel.loaderWindowService = ILoaderWindowService(param1); },function():ILoaderWindowService { return LobbyLayoutNotifyModel.loaderWindowService; }); osgi.injectService(ILobbyLayoutService,function(param1:Object):void { LobbyLayoutNotifyModel.lobbyLayoutService = ILobbyLayoutService(param1); },function():ILobbyLayoutService { return LobbyLayoutNotifyModel.lobbyLayoutService; }); osgi.injectService(LogService,function(param1:Object):void { LobbyLayoutNotifyModel.logService = LogService(param1); },function():LogService { return LobbyLayoutNotifyModel.logService; }); osgi.injectService(IModalLoaderService,function(param1:Object):void { LobbyLayoutNotifyModel.modalLoaderService = IModalLoaderService(param1); },function():IModalLoaderService { return LobbyLayoutNotifyModel.modalLoaderService; }); osgi.injectService(YandexMetricaService,function(param1:Object):void { LobbyLayoutNotifyModel.ymService = YandexMetricaService(param1); },function():YandexMetricaService { return LobbyLayoutNotifyModel.ymService; }); osgi.injectService(TanksAddressService,function(param1:Object):void { MoveUserToServerModel.addressService = TanksAddressService(param1); },function():TanksAddressService { return MoveUserToServerModel.addressService; }); osgi.injectService(IServerHaltService,function(param1:Object):void { ServerHaltModel.serverHaltService = IServerHaltService(param1); },function():IServerHaltService { return ServerHaltModel.serverHaltService; }); osgi.injectService(ILobbyLayoutService,function(param1:Object):void { AutomaticEnterExitService.lobbyLayoutService = ILobbyLayoutService(param1); },function():ILobbyLayoutService { return AutomaticEnterExitService.lobbyLayoutService; }); osgi.injectService(LogService,function(param1:Object):void { AutomaticEnterExitService.logService = LogService(param1); },function():LogService { return AutomaticEnterExitService.logService; }); osgi.injectService(PaymentDisplayService,function(param1:Object):void { AutomaticEnterExitService.paymentDisplayService = PaymentDisplayService(param1); },function():PaymentDisplayService { return AutomaticEnterExitService.paymentDisplayService; }); osgi.injectService(ILocaleService,function(param1:Object):void { DateFormatter.localeService = ILocaleService(param1); },function():ILocaleService { return DateFormatter.localeService; }); osgi.injectService(LogService,function(param1:Object):void { DateFormatter.logService = LogService(param1); },function():LogService { return DateFormatter.logService; }); osgi.injectService(IAlertService,function(param1:Object):void { LobbyLayoutService.alertService = IAlertService(param1); },function():IAlertService { return LobbyLayoutService.alertService; }); osgi.injectService(IBattleInfoService,function(param1:Object):void { LobbyLayoutService.battleInfoService = IBattleInfoService(param1); },function():IBattleInfoService { return LobbyLayoutService.battleInfoService; }); osgi.injectService(IDialogWindowsDispatcherService,function(param1:Object):void { LobbyLayoutService.dialogWindowsDispatcherService = IDialogWindowsDispatcherService(param1); },function():IDialogWindowsDispatcherService { return LobbyLayoutService.dialogWindowsDispatcherService; }); osgi.injectService(ILocaleService,function(param1:Object):void { LobbyLayoutService.localeService = ILocaleService(param1); },function():ILocaleService { return LobbyLayoutService.localeService; }); osgi.injectService(IPartnerService,function(param1:Object):void { LobbyLayoutService.partnersService = IPartnerService(param1); },function():IPartnerService { return LobbyLayoutService.partnersService; }); osgi.injectService(IStorageService,function(param1:Object):void { LobbyLayoutService.storageService = IStorageService(param1); },function():IStorageService { return LobbyLayoutService.storageService; }); osgi.injectService(UserChangeGameScreenService,function(param1:Object):void { LobbyLayoutService.userChangeGameScreenService = UserChangeGameScreenService(param1); },function():UserChangeGameScreenService { return LobbyLayoutService.userChangeGameScreenService; }); osgi.injectService(IUserInfoService,function(param1:Object):void { LobbyLayoutService.userInfoService = IUserInfoService(param1); },function():IUserInfoService { return LobbyLayoutService.userInfoService; }); osgi.injectService(ILocaleService,function(param1:Object):void { SocialNetworkNameUtils.localeService = ILocaleService(param1); },function():ILocaleService { return SocialNetworkNameUtils.localeService; }); osgi.injectService(IDisplay,function(param1:Object):void { Notification.display = IDisplay(param1); },function():IDisplay { return Notification.display; }); osgi.injectService(INotificationSoundService,function(param1:Object):void { Notification.notificationSoundService = INotificationSoundService(param1); },function():INotificationSoundService { return Notification.notificationSoundService; }); osgi.injectService(IDisplay,function(param1:Object):void { StageQualityService.display = IDisplay(param1); },function():IDisplay { return StageQualityService.display; }); osgi.injectService(ILocaleService,function(param1:Object):void { TimeUnitService.localeService = ILocaleService(param1); },function():ILocaleService { return TimeUnitService.localeService; }); modelRegister = osgi.getService(ModelRegistry) as ModelRegistry; modelRegister.add(new AlertModel()); modelRegister.add(new BattleLinkActivatorModel()); modelRegisterAdapt = osgi.getService(ModelRegistry) as ModelRegistry; modelRegisterAdapt.registerAdapt(IServerCaptcha,IServerCaptchaAdapt); modelRegisterAdapt.registerEvents(IServerCaptcha,IServerCaptchaEvents); modelRegister.add(new ServerCaptchaModel()); modelRegister.add(new ChallengeTimeModel()); modelRegister.add(new ColoringModel()); modelRegisterAdapt.registerAdapt(IColoring,IColoringAdapt); modelRegisterAdapt.registerEvents(IColoring,IColoringEvents); modelRegisterAdapt.registerAdapt(Detach,DetachAdapt); modelRegisterAdapt.registerEvents(Detach,DetachEvents); modelRegister.add(new DetachModel()); modelRegisterAdapt.registerAdapt(ExternalAuthApi,ExternalAuthApiAdapt); modelRegisterAdapt.registerEvents(ExternalAuthApi,ExternalAuthApiEvents); modelRegister.add(new ExternalAuthApiModel()); modelRegister.add(new GPUDetectorModel()); modelRegisterAdapt.registerAdapt(ILobbyLayout,ILobbyLayoutAdapt); modelRegisterAdapt.registerEvents(ILobbyLayout,ILobbyLayoutEvents); modelRegister.add(new LobbyLayoutModel()); modelRegisterAdapt.registerAdapt(ILobbyLayoutNotify,ILobbyLayoutNotifyAdapt); modelRegisterAdapt.registerEvents(ILobbyLayoutNotify,ILobbyLayoutNotifyEvents); modelRegister.add(new LobbyLayoutNotifyModel()); modelRegister.add(new MoveUserToServerModel()); modelRegisterAdapt.registerAdapt(DataOwner,DataOwnerAdapt); modelRegisterAdapt.registerEvents(DataOwner,DataOwnerEvents); modelRegister.add(new DataOwnerModel()); modelRegister.add(new ServerHaltModel()); } public function stop(param1:OSGi) : void { } } }
package scpacker.resource.cache { import flash.events.Event; import flash.events.IOErrorEvent; import flash.events.SecurityErrorEvent; import flash.media.Sound; import flash.media.SoundLoaderContext; import flash.net.URLLoader; import flash.net.URLLoaderDataFormat; import flash.net.URLRequest; import flash.utils.ByteArray; import flash.utils.getDefinitionByName; public class SoundCacheLoader extends Sound { private var encodedUrl:String; private var cacheDirectory:Object; private var context:SoundLoaderContext; private var FileClass:Class; private var FileStreamClass:Class; private var FileModeClass:Class; public function SoundCacheLoader() { super(); if(CacheURLLoader.isDesktop) { this.FileClass = getDefinitionByName("flash.filesystem.File") as Class; this.FileStreamClass = getDefinitionByName("flash.filesystem.FileStream") as Class; this.FileModeClass = getDefinitionByName("flash.filesystem.FileMode") as Class; this.cacheDirectory = this.FileClass.applicationStorageDirectory.resolvePath("cache"); if(!this.cacheDirectory.exists) { this.cacheDirectory.createDirectory(); } else if(!this.cacheDirectory.isDirectory) { throw new Error("Cannot create directory." + this.cacheDirectory.nativePath + " is already exists."); } } } override public function load(param1:URLRequest, param2:SoundLoaderContext = null) : void { if(!CacheURLLoader.isDesktop || param1 == null) { super.load(param1,param2); return; } this.context = param2; var _loc3_:Object = this.cacheDirectory.resolvePath(param1.url); if(_loc3_.exists) { super.load(new URLRequest(_loc3_.url),param2); return; } var _loc4_:URLLoader = new URLLoader(); _loc4_.dataFormat = URLLoaderDataFormat.BINARY; _loc4_.addEventListener(Event.COMPLETE,this.onBytesLoaded,false,0,true); _loc4_.addEventListener(IOErrorEvent.IO_ERROR,this.onIOError,false,0,true); _loc4_.addEventListener(SecurityErrorEvent.SECURITY_ERROR,this.onSecurityError,false,0,true); _loc4_.load(param1); } private function onIOError(param1:Event) : void { dispatchEvent(new IOErrorEvent("SoundCacheLoader: IOError!")); } private function onSecurityError(param1:Event) : void { dispatchEvent(new SecurityErrorEvent("SoundCacheLoader: Security error!")); } private function onBytesLoaded(param1:Event) : void { var e:Event = param1; var bytes:ByteArray = URLLoader(e.target).data as ByteArray; var file:Object = new this.FileClass(this.cacheDirectory.resolvePath(this.encodedUrl).nativePath); var fileStream:Object = new this.FileStreamClass(); try { fileStream.open(file,this.FileModeClass.WRITE); fileStream.writeBytes(bytes); fileStream.close(); } catch(e:Error) { dispatchEvent(new IOErrorEvent("SoundCacheLoader error! " + e.message + "url: " + encodedUrl)); } super.load(new URLRequest(file.url),this.context); } } }
package alternativa.tanks.sfx { import alternativa.engine3d.core.Light3D; import alternativa.tanks.battle.scene3d.scene3dcontainer.Scene3DContainer; import alternativa.tanks.camera.GameCamera; import alternativa.tanks.utils.objectpool.Pool; import alternativa.tanks.utils.objectpool.PooledObject; public class StreamLightEffect extends PooledObject implements GraphicEffect { private static const FADE_TIME:int = 250; protected var light:Light3D; protected var startAnimation:LightAnimation; protected var loopAnimation:LightAnimation; protected var startTime:int; protected var loopTime:int; protected var currentLoopTime:int; protected var currentTime:int; protected var starting:Boolean; protected var positionProvider:Object3DPositionProvider; protected var alive:Boolean; protected var random:int; protected var fading:Boolean; protected var fadeTime:int; protected var container:Scene3DContainer; public function StreamLightEffect(param1:Pool, param2:Light3D) { super(param1); this.light = param2; } public function addedToScene(param1:Scene3DContainer) : void { this.container = param1; param1.addChild(this.light); } private function startLoop() : void { this.currentLoopTime = this.loopTime + (Math.random() * this.random - this.random / 2); } public function play(param1:int, param2:GameCamera) : Boolean { if(!this.alive) { return false; } if(this.starting) { this.currentTime += param1; this.startAnimation.updateByTime(this.light,this.currentTime,this.startTime); if(this.currentTime >= this.startTime) { this.starting = false; this.currentTime = 0; this.startLoop(); } } else { this.currentTime += param1; if(this.currentTime > this.currentLoopTime) { this.currentTime %= this.currentLoopTime; this.startLoop(); } this.loopAnimation.updateByTime(this.light,this.currentTime,this.loopTime); } this.positionProvider.updateObjectPosition(this.light,param2,param1); if(this.fading) { this.fadeTime += param1; if(this.fadeTime <= FADE_TIME) { this.light.intensity *= 1 - this.fadeTime / FADE_TIME; } else { this.light.intensity = 0; this.kill(); } } return true; } public function destroy() : void { this.container.removeChild(this.light); this.container = null; this.startAnimation = null; this.loopAnimation = null; this.positionProvider.destroy(); this.positionProvider = null; recycle(); } public function kill() : void { this.alive = false; } public function stop() : void { this.fading = true; this.fadeTime = 0; } } }
package alternativa.osgi.service.loaderParams { public class LoaderParamsService implements ILoaderParamsService { private var loaderParams:Object; public function LoaderParamsService(loaderParams:Object) { super(); this.loaderParams = loaderParams; } public function get params() : Object { return this.loaderParams; } } }
package com.alternativaplatform.projects.tanks.client.warfare.models.tankparts.weapon.flamethrower { public interface IFlameThrowerModelBase { } }
package platform.clients.fp10.libraries.alternativapartners.osgi { import alternativa.osgi.OSGi; import alternativa.osgi.bundle.IBundleActivator; import platform.clients.fp10.libraries.alternativapartners.service.IPartnerService; import platform.clients.fp10.libraries.alternativapartners.service.impl.PartnerService; public class PartnersActivator implements IBundleActivator { public function PartnersActivator() { super(); } public function start(param1:OSGi) : void { var local2:IPartnerService = new PartnerService(); param1.registerService(IPartnerService,local2); } public function stop(param1:OSGi) : void { } } }
package alternativa.tanks.view.events { import flash.events.Event; public class AntiAddictionInfoUpdatedEvent extends Event { public static const EVENT:String = "AntiAddictionInfoUpdatedEvent.EVENT"; public function AntiAddictionInfoUpdatedEvent() { super(EVENT); } } }
package alternativa.tanks.battle.objects.tank { import alternativa.math.Vector3; public class LocalHullTransformUpdater implements HullTransformUpdater { private static const position:Vector3 = new Vector3(); private static const eulerAngles:Vector3 = new Vector3(); public var tank:Tank; public function LocalHullTransformUpdater(param1:Tank) { super(); this.tank = param1; } public function reset() : void { } public function update(param1:Number) : void { position.copy(this.tank.skinCenterOffset); position.transform4(this.tank.interpolatedTransform); this.tank.interpolatedOrientation.getEulerAngles(eulerAngles); this.tank.getSkin().updateHullTransform(position,eulerAngles); } } }
package alternativa.tanks.gui.payment.controls { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.gui.payment.controls.ProceedButton_ButtonRight.png")] public class ProceedButton_ButtonRight extends BitmapAsset { public function ProceedButton_ButtonRight() { super(); } } }
package _codec.projects.tanks.client.battlefield.models.effects.description { import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.codec.OptionalCodecDecorator; import alternativa.protocol.impl.LengthCodecHelper; import alternativa.protocol.info.EnumCodecInfo; import projects.tanks.client.battlefield.models.effects.description.EffectCategory; public class VectorCodecEffectCategoryLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecEffectCategoryLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new EnumCodecInfo(EffectCategory,false)); if(this.optionalElement) { this.elementCodec = new OptionalCodecDecorator(this.elementCodec); } } public function decode(param1:ProtocolBuffer) : Object { var local2:int = int(LengthCodecHelper.decodeLength(param1)); var local3:Vector.<EffectCategory> = new Vector.<EffectCategory>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = EffectCategory(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:EffectCategory = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<EffectCategory> = Vector.<EffectCategory>(param2); var local5:int = int(local3.length); LengthCodecHelper.encodeLength(param1,local5); var local6:int = 0; while(local6 < local5) { this.elementCodec.encode(param1,local3[local6]); local6++; } } } }
package controls.resultassets { import assets.resultwindow.items_mini_CENTER; import assets.resultwindow.items_mini_LEFT; import assets.resultwindow.items_mini_RIGHT; import controls.cellrenderer.ButtonState; import flash.display.BitmapData; import flash.display.Graphics; import flash.geom.Point; import flash.geom.Rectangle; public class WhiteFrame extends ButtonState { public var bmpLeftSmall:BitmapData; public var bmpRightSmall:BitmapData; public function WhiteFrame() { super(); bmpLeft = new items_mini_LEFT(1,1); bmpCenter = new items_mini_CENTER(1,1); bmpRight = new items_mini_RIGHT(1,1); this.bmpLeftSmall = new BitmapData(10,40); this.bmpRightSmall = new BitmapData(10,40); this.bmpLeftSmall.copyPixels(bmpLeft,new Rectangle(0,0,10,40),new Point()); this.bmpRightSmall.copyPixels(bmpRight,new Rectangle(10,0,10,40),new Point()); } override public function draw() : void { var local1:Graphics = null; if(_width >= 40) { local1 = l.graphics; local1.clear(); local1.beginBitmapFill(bmpLeft); local1.drawRect(0,0,20,40); local1.endFill(); l.x = 0; l.y = 0; local1 = c.graphics; local1.clear(); local1.beginBitmapFill(bmpCenter); local1.drawRect(0,0,_width - 40,40); local1.endFill(); c.x = 20; c.y = 0; local1 = r.graphics; local1.clear(); local1.beginBitmapFill(bmpRight); local1.drawRect(0,0,20,40); local1.endFill(); r.x = _width - 20; r.y = 0; } else { local1 = l.graphics; local1.clear(); local1.beginBitmapFill(this.bmpLeftSmall); local1.drawRect(0,0,10,40); local1.endFill(); l.x = 0; l.y = 0; local1 = c.graphics; local1.clear(); local1.beginBitmapFill(bmpCenter); local1.drawRect(0,0,_width - 20,40); local1.endFill(); c.x = 10; c.y = 0; local1 = r.graphics; local1.clear(); local1.beginBitmapFill(this.bmpRightSmall); local1.drawRect(0,0,10,40); local1.endFill(); r.x = _width - 10; r.y = 0; } } } }
package com.alternativaplatform.projects.tanks.client.warfare.models.tankparts.weapon.terminator { public interface ITerminatorModelBase { } }
package _codec.projects.tanks.client.battlefield.models.tankparts.weapon.twins { import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.codec.OptionalCodecDecorator; import alternativa.protocol.impl.LengthCodecHelper; import alternativa.protocol.info.TypeCodecInfo; import projects.tanks.client.battlefield.models.tankparts.weapon.twins.TwinsCC; public class VectorCodecTwinsCCLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecTwinsCCLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new TypeCodecInfo(TwinsCC,false)); if(this.optionalElement) { this.elementCodec = new OptionalCodecDecorator(this.elementCodec); } } public function decode(param1:ProtocolBuffer) : Object { var local2:int = int(LengthCodecHelper.decodeLength(param1)); var local3:Vector.<TwinsCC> = new Vector.<TwinsCC>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = TwinsCC(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:TwinsCC = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<TwinsCC> = Vector.<TwinsCC>(param2); var local5:int = int(local3.length); LengthCodecHelper.encodeLength(param1,local5); var local6:int = 0; while(local6 < local5) { this.elementCodec.encode(param1,local3[local6]); local6++; } } } }
package alternativa.engine3d.core { import alternativa.gfx.agal.VertexShader; public class DepthRendererBlurVertexShader extends VertexShader { public function DepthRendererBlurVertexShader() { super(); mov(op,va0); mov(v0,va1); } } }
package alternativa.tanks.model.payment.shop.specialkit { import projects.tanks.client.panel.model.shop.specialkit.ISpecialKitPackageModelBase; import projects.tanks.client.panel.model.shop.specialkit.SpecialKitPackageCC; import projects.tanks.client.panel.model.shop.specialkit.SpecialKitPackageModelBase; [ModelInfo] public class SpecialKitPackageModel extends SpecialKitPackageModelBase implements ISpecialKitPackageModelBase, SpecialKitPackage { public function SpecialKitPackageModel() { super(); } public function getCrystalsAmount() : int { return getInitParam().crystalsAmount; } public function getPremiumDurationInDays() : int { return getInitParam().premiumDurationInDays; } public function getEverySupplyAmount() : int { return getInitParam().everySupplyAmount; } public function getGoldAmount() : int { return getInitParam().goldAmount; } public function hasAdditionalItem() : Boolean { return getInitParam().withAdditionalItem; } public function getItemsCount() : int { return getInitParam().itemsCount; } public function getPackageData() : SpecialKitPackageCC { return getInitParam(); } } }
package forms.ranks { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/forms.ranks.DefaultRanksBitmaps_bitmapSmallRank28.png")] public class DefaultRanksBitmaps_bitmapSmallRank28 extends BitmapAsset { public function DefaultRanksBitmaps_bitmapSmallRank28() { super(); } } }
package alternativa.tanks.gui.notinclan.clanslist { import controls.cellrenderer.CellNormal; import controls.cellrenderer.CellNormalSelected; import fl.controls.listClasses.CellRenderer; import fl.controls.listClasses.ListData; import flash.display.DisplayObject; import flash.events.Event; import forms.Styles; public class ClansListRenderer extends CellRenderer { private var clanInfoLabel:ClanInfoLabel; public function ClansListRenderer() { super(); } override public function set data(param1:Object) : void { _data = param1; mouseEnabled = false; mouseChildren = true; buttonMode = useHandCursor = false; this.createLabels(_data); var local2:DisplayObject = new CellNormal(); var local3:DisplayObject = new CellNormalSelected(); setStyle(Styles.UP_SKIN,local2); setStyle(Styles.DOWN_SKIN,local2); setStyle(Styles.OVER_SKIN,local2); setStyle(Styles.SELECTED_UP_SKIN,local3); setStyle(Styles.SELECTED_OVER_SKIN,local3); setStyle(Styles.SELECTED_DOWN_SKIN,local3); this.clanInfoLabel.width = _width; addEventListener(Event.RESIZE,this.onResize,false,0,true); this.onResize(); } override public function set listData(param1:ListData) : void { _listData = param1; label = _listData.label; if(this.clanInfoLabel != null) { setStyle("icon",this.clanInfoLabel); } } private function onResize(param1:Event = null) : void { this.clanInfoLabel.width = _width; } private function createLabels(param1:Object) : void { if(param1.type == ClanListType.INCOMING) { this.clanInfoLabel = new UserIncomingRequestLabel(param1.id); } else { this.clanInfoLabel = new UserOutgoingRequestLabel(param1.id); } addChild(this.clanInfoLabel); } public function onRollOut() : void { var local1:UserIncomingRequestLabel = null; super.selected = false; if(this.clanInfoLabel is UserIncomingRequestLabel) { local1 = UserIncomingRequestLabel(this.clanInfoLabel); if(local1.newIndicator != null) { local1.newIndicator.updateNotifications(); } } } public function onRollOver() : void { var local1:UserIncomingRequestLabel = null; super.selected = true; if(this.clanInfoLabel is UserIncomingRequestLabel) { local1 = UserIncomingRequestLabel(this.clanInfoLabel); if(local1.newIndicator != null) { local1.newIndicator.visible = false; } } } } }
package projects.tanks.client.panel.model.payment.panel { import alternativa.osgi.OSGi; import alternativa.protocol.IProtocol; import alternativa.protocol.OptionalMap; import alternativa.protocol.ProtocolBuffer; import flash.utils.ByteArray; import platform.client.fp10.core.model.IModel; public class PaymentButtonModelServer { private var protocol:IProtocol; private var protocolBuffer:ProtocolBuffer; private var model:IModel; public function PaymentButtonModelServer(param1:IModel) { super(); this.model = param1; var local2:ByteArray = new ByteArray(); this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol)); this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap()); } } }
package controls.chat { import mx.core.BitmapAsset; [ExcludeClass] public class ChatPermissionsLevel_developer extends BitmapAsset { public function ChatPermissionsLevel_developer() { super(); } } }
package alternativa.tanks.gui { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.gui.ItemInfoPanelBitmaps_selfMedicationPercentClass.png")] public class ItemInfoPanelBitmaps_selfMedicationPercentClass extends BitmapAsset { public function ItemInfoPanelBitmaps_selfMedicationPercentClass() { super(); } } }
package alternativa.osgi.service.command.impl { import alternativa.osgi.service.command.CommandService; import alternativa.osgi.service.command.FormattedOutput; import flash.system.System; public class DefaultCommands { private var commandService:CommandServiceImpl; public function DefaultCommands(param1:CommandService) { super(); this.commandService = param1 as CommandServiceImpl; param1.registerCommand("cmd","help","Список всех команд",[],this.cmdList); param1.registerCommand("cmd","help","Помощь по конкретной команде",[String],this.cmdHelp); param1.registerCommand("cmd","grep","Поиск по строке",[String,Vector],this.cmdGrep); param1.registerCommand("cmd","clip","Копировать вывод конвеера в буфер обмена",[Vector],this.cmdClipboard); } private function cmdList(param1:FormattedOutput) : void { var command:Command = null; var output:FormattedOutput = param1; var sortedCommands:Vector.<Command> = this.commandService.commands.sort(function(param1:Command, param2:Command):Number { var local3:* = param1.scope.localeCompare(param2.scope); if(local3 != 0) { return local3; } return param1.cmd.localeCompare(param2.cmd); }); var i:int = 0; while(i < sortedCommands.length) { command = sortedCommands[i]; output.addText(command.scope + "." + command.cmd); i++; } } private function cmdHelp(param1:FormattedOutput, param2:String) : void { var local5:Command = null; var local3:Boolean = false; var local4:int = 0; while(local4 < this.commandService.commands.length) { local5 = this.commandService.commands[local4]; if(local5.scope + "." + local5.cmd == param2 || local5.scope + "." + local5.cmd == "cmd." + param2) { param1.addText(local5.scope + "." + local5.cmd + " " + local5.help()); local3 = true; } local4++; } if(!local3) { param1.addText("Команда не найдена " + param2); } } private function cmdGrep(param1:FormattedOutput, param2:String, param3:Vector.<String>) : void { var local4:String = null; for each(local4 in param3) { if(local4.indexOf(param2) != -1) { param1.addText(local4); } } } private function cmdClipboard(param1:FormattedOutput, param2:Vector.<String>) : void { var local3:String = param2.join("\n"); System.setClipboard(local3); param1.addLines(param2); } } }
package alternativa.tanks.display.usertitle { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.display.usertitle.EffectIndicator_iconHealthCls.png")] public class EffectIndicator_iconHealthCls extends BitmapAsset { public function EffectIndicator_iconHealthCls() { super(); } } }
package platform.client.fp10.core.network.command { import alternativa.protocol.ProtocolBuffer; import alternativa.types.Long; import flash.utils.ByteArray; public class SpaceCommand { public static const PRODUCE_HASH:int = 3; public static const SPACE_CONNECTED:int = 4; public var objectId:Long; public var methodId:Long; public var protocolBuffer:ProtocolBuffer; public function SpaceCommand(param1:Long, param2:Long, param3:ProtocolBuffer) { super(); this.objectId = param1; this.methodId = param2; this.protocolBuffer = param3; } public function toString() : String { return "[objectId=" + this.objectId + ", methodId=" + this.methodId + ", protocolBuffer length=" + ByteArray(this.protocolBuffer.reader).length + ", protocolBuffer=" + this.protocolBuffer.reader + "]"; } } }
package projects.tanks.client.battlefield.models.battle.cp { import alternativa.osgi.OSGi; import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.EnumCodecInfo; import alternativa.protocol.info.TypeCodecInfo; import alternativa.types.Float; import alternativa.types.Long; import platform.client.fp10.core.model.IModel; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.registry.ModelRegistry; import projects.tanks.client.battleservice.model.battle.team.BattleTeam; public class ControlPointsModelBase extends Model { private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol)); protected var server:ControlPointsModelServer; private var client:IControlPointsModelBase = IControlPointsModelBase(this); private var modelId:Long = Long.getLong(375259874,-2064506790); private var _pointCaptureStartedId:Long = Long.getLong(113336798,-635616124); private var _pointCaptureStarted_teamCodec:ICodec; private var _pointCaptureStoppedId:Long = Long.getLong(113336798,-648481992); private var _pointCaptureStopped_teamCodec:ICodec; private var _setPointProgressId:Long = Long.getLong(1656540814,-150441162); private var _setPointProgress_pointIdCodec:ICodec; private var _setPointProgress_progressCodec:ICodec; private var _setPointProgress_progressSpeedCodec:ICodec; private var _setPointStateId:Long = Long.getLong(93222359,396117780); private var _setPointState_pointIdCodec:ICodec; private var _setPointState_stateCodec:ICodec; private var _stopBattleId:Long = Long.getLong(1109525934,-1995327689); private var _tankEnteredPointZoneId:Long = Long.getLong(1209531510,1444573534); private var _tankEnteredPointZone_pointIdCodec:ICodec; private var _tankEnteredPointZone_tankIdCodec:ICodec; private var _tankLeftPointZoneId:Long = Long.getLong(1944648201,859419652); private var _tankLeftPointZone_pointIdCodec:ICodec; private var _tankLeftPointZone_tankIdCodec:ICodec; public function ControlPointsModelBase() { super(); this.initCodecs(); } protected function initCodecs() : void { this.server = new ControlPointsModelServer(IModel(this)); var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry)); local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(ControlPointsCC,false))); this._pointCaptureStarted_teamCodec = this._protocol.getCodec(new EnumCodecInfo(BattleTeam,false)); this._pointCaptureStopped_teamCodec = this._protocol.getCodec(new EnumCodecInfo(BattleTeam,false)); this._setPointProgress_pointIdCodec = this._protocol.getCodec(new TypeCodecInfo(int,false)); this._setPointProgress_progressCodec = this._protocol.getCodec(new TypeCodecInfo(Float,false)); this._setPointProgress_progressSpeedCodec = this._protocol.getCodec(new TypeCodecInfo(Float,false)); this._setPointState_pointIdCodec = this._protocol.getCodec(new TypeCodecInfo(int,false)); this._setPointState_stateCodec = this._protocol.getCodec(new EnumCodecInfo(ControlPointState,false)); this._tankEnteredPointZone_pointIdCodec = this._protocol.getCodec(new TypeCodecInfo(int,false)); this._tankEnteredPointZone_tankIdCodec = this._protocol.getCodec(new TypeCodecInfo(Long,false)); this._tankLeftPointZone_pointIdCodec = this._protocol.getCodec(new TypeCodecInfo(int,false)); this._tankLeftPointZone_tankIdCodec = this._protocol.getCodec(new TypeCodecInfo(Long,false)); } protected function getInitParam() : ControlPointsCC { return ControlPointsCC(initParams[Model.object]); } override public function invoke(param1:Long, param2:ProtocolBuffer) : void { switch(param1) { case this._pointCaptureStartedId: this.client.pointCaptureStarted(BattleTeam(this._pointCaptureStarted_teamCodec.decode(param2))); break; case this._pointCaptureStoppedId: this.client.pointCaptureStopped(BattleTeam(this._pointCaptureStopped_teamCodec.decode(param2))); break; case this._setPointProgressId: this.client.setPointProgress(int(this._setPointProgress_pointIdCodec.decode(param2)),Number(this._setPointProgress_progressCodec.decode(param2)),Number(this._setPointProgress_progressSpeedCodec.decode(param2))); break; case this._setPointStateId: this.client.setPointState(int(this._setPointState_pointIdCodec.decode(param2)),ControlPointState(this._setPointState_stateCodec.decode(param2))); break; case this._stopBattleId: this.client.stopBattle(); break; case this._tankEnteredPointZoneId: this.client.tankEnteredPointZone(int(this._tankEnteredPointZone_pointIdCodec.decode(param2)),Long(this._tankEnteredPointZone_tankIdCodec.decode(param2))); break; case this._tankLeftPointZoneId: this.client.tankLeftPointZone(int(this._tankLeftPointZone_pointIdCodec.decode(param2)),Long(this._tankLeftPointZone_tankIdCodec.decode(param2))); } } override public function get id() : Long { return this.modelId; } } }
package alternativa.debug.dump { import alternativa.init.Main; import alternativa.model.IModel; import alternativa.osgi.service.dump.dumper.IDumper; import alternativa.service.IModelService; public class ModelDumper implements IDumper { public function ModelDumper() { super(); } public function dump(params:Vector.<String>) : String { var result:String = "\n"; var modelRegister:IModelService = IModelService(Main.osgi.getService(IModelService)); var models:Vector.<IModel> = modelRegister.modelsList; for(var i:int = 0; i < models.length; i++) { result += " " + models[i] + "\n"; result += " id: " + models[i].id + "\n"; result += " interfaces: " + modelRegister.getInterfacesForModel(models[i].id) + "\n\n"; } return result + "\n"; } public function get dumperName() : String { return "model"; } } }
package alternativa.tanks.models.battle.facilities { import alternativa.math.Vector3; import alternativa.tanks.battle.objects.tank.Tank; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; public class BattleFacilitiesCheckerAdapt implements BattleFacilitiesChecker { private var object:IGameObject; private var impl:BattleFacilitiesChecker; public function BattleFacilitiesCheckerAdapt(param1:IGameObject, param2:BattleFacilitiesChecker) { super(); this.object = param1; this.impl = param2; } public function checkFacilityZonesDemandsStateCorrection(param1:Vector3, param2:Vector3) : Boolean { var result:Boolean = false; var previousSentPosition:Vector3 = param1; var currentPosition:Vector3 = param2; try { Model.object = this.object; result = Boolean(this.impl.checkFacilityZonesDemandsStateCorrection(previousSentPosition,currentPosition)); } finally { Model.popObject(); } return result; } public function onMoveCommand(param1:Tank, param2:Vector3, param3:Vector3) : void { var tank:Tank = param1; var prevPosition:Vector3 = param2; var newPosition:Vector3 = param3; try { Model.object = this.object; this.impl.onMoveCommand(tank,prevPosition,newPosition); } finally { Model.popObject(); } } } }
package alternativa.tanks.models.clan.accepted { import alternativa.types.Long; [ModelInterface] public interface IClanAcceptedModel { function getAcceptedUsers() : Vector.<Long>; } }
package alternativa.tanks.models.tank.ultimate.wasp.bomb { import alternativa.math.Vector3; import alternativa.tanks.battle.objects.tank.ClientTankState; import alternativa.tanks.battle.objects.tank.Tank; public class WaspBombData implements LocalTankPositionProvider { public var localTank:Tank = null; public function WaspBombData() { super(); } public function getLocalTankPosition(param1:Vector3) : void { if(this.localTank != null && this.localTank.state != ClientTankState.DEAD) { this.localTank.getPhysicsPosition(param1); } } } }
package projects.tanks.client.panel.model.bonus.showing.info { import alternativa.osgi.OSGi; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.TypeCodecInfo; import alternativa.types.Long; import platform.client.fp10.core.model.IModel; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.registry.ModelRegistry; public class BonusInfoModelBase extends Model { private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol)); protected var server:BonusInfoModelServer; private var client:IBonusInfoModelBase = IBonusInfoModelBase(this); private var modelId:Long = Long.getLong(833813262,1737001283); public function BonusInfoModelBase() { super(); this.initCodecs(); } protected function initCodecs() : void { this.server = new BonusInfoModelServer(IModel(this)); var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry)); local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(BonusInfoCC,false))); } protected function getInitParam() : BonusInfoCC { return BonusInfoCC(initParams[Model.object]); } override public function invoke(param1:Long, param2:ProtocolBuffer) : void { var local3:* = param1; switch(false ? 0 : 0) { } } override public function get id() : Long { return this.modelId; } } }
package alternativa.tanks.models.bonus.region { import alternativa.engine3d.objects.Mesh; import alternativa.math.Vector3; import alternativa.tanks.battle.scene3d.Renderer; public class GoldBonusRegion extends BonusRegion implements Renderer { public static const SHOW_TIME:int = 1000; public static const HIDE_TIME:int = 3000; private var showing:Boolean; private var hiding:Boolean; private var removeAfterHide:Boolean; private var _alphaMultiplier:BonusRegionAlphaMultiplier; public function GoldBonusRegion(param1:Mesh, param2:Vector3) { super(param1,param2,true); this._alphaMultiplier = new BonusRegionAlphaMultiplier(); } override public function addToGame() : void { super.addToGame(); battleService.getBattleScene3D().addRenderer(this,0); } override public function removeFromGame() : void { super.removeFromGame(); battleService.getBattleScene3D().removeRenderer(this,0); } override public function hide() : void { this.hiding = true; this._alphaMultiplier.init(battleService.getBattleRunner().getPhysicsTime(),HIDE_TIME,1); } override public function show() : void { this.showing = true; this._alphaMultiplier.init(battleService.getBattleRunner().getPhysicsTime(),SHOW_TIME,0); } override public function hideAndRemoveFromGame() : void { this.removeAfterHide = true; this.hide(); } public function render(param1:int, param2:int) : void { if(this.showing) { mesh.alpha = this.calculateShowingAlphaForTime(param1); if(mesh.alpha == 1) { this.showing = false; } } if(this.hiding) { mesh.alpha = this.calculateHidingAlphaForTime(param1); if(mesh.alpha == 0) { this.hiding = false; if(this.removeAfterHide) { this.removeFromGame(); } } } } private function calculateHidingAlphaForTime(param1:int) : Number { return this._alphaMultiplier.getAlpha(param1,false); } private function calculateShowingAlphaForTime(param1:int) : Number { return this._alphaMultiplier.getAlpha(param1,true); } } }
package alternativa.proplib.types { public class PropGroup { public var name:String; public var props:Vector.<PropData>; public var groups:Vector.<PropGroup>; public function PropGroup(name:String) { super(); this.name = name; } public function getPropByName(propName:String) : PropData { var prop:PropData = null; if(this.props == null) { return null; } for each(prop in this.props) { if(prop.name == propName) { return prop; } } return null; } public function getGroupByName(groupName:String) : PropGroup { var group:PropGroup = null; if(this.groups == null) { return null; } for each(group in this.groups) { if(group.name == groupName) { return group; } } return null; } public function addProp(prop:PropData) : void { if(this.props == null) { this.props = new Vector.<PropData>(); } this.props.push(prop); } public function addGroup(group:PropGroup) : void { if(this.groups == null) { this.groups = new Vector.<PropGroup>(); } this.groups.push(group); } public function traceGroup() : void { var group:PropGroup = null; var prop:PropData = null; if(this.groups != null) { for each(group in this.groups) { group.traceGroup(); } } if(this.props != null) { for each(prop in this.props) { prop.traceProp(); } } } } }
package alternativa.utils { public interface ITextureConstructorListener { function onTextureReady(param1:TextureConstructor) : void; } }
package projects.tanks.client.garage.models.item.item3d { import alternativa.osgi.OSGi; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.TypeCodecInfo; import alternativa.types.Long; import platform.client.fp10.core.model.IModel; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.registry.ModelRegistry; public class Item3DModelBase extends Model { private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol)); protected var server:Item3DModelServer; private var client:IItem3DModelBase = IItem3DModelBase(this); private var modelId:Long = Long.getLong(1739715120,-17857031); public function Item3DModelBase() { super(); this.initCodecs(); } protected function initCodecs() : void { this.server = new Item3DModelServer(IModel(this)); var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry)); local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(Item3DCC,false))); } protected function getInitParam() : Item3DCC { return Item3DCC(initParams[Model.object]); } override public function invoke(param1:Long, param2:ProtocolBuffer) : void { var local3:* = param1; switch(false ? 0 : 0) { } } override public function get id() : Long { return this.modelId; } } }
package projects.tanks.client.garage.models.item.drone { import alternativa.osgi.OSGi; import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.TypeCodecInfo; import alternativa.types.Long; import platform.client.fp10.core.model.IModel; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.registry.ModelRegistry; public class HasBatteriesNotifyModelBase extends Model { private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol)); protected var server:HasBatteriesNotifyModelServer; private var client:IHasBatteriesNotifyModelBase = IHasBatteriesNotifyModelBase(this); private var modelId:Long = Long.getLong(563557196,-1799629517); private var _setHasBatteriesId:Long = Long.getLong(1519071544,-862454895); private var _setHasBatteries_hasBatteriesCodec:ICodec; public function HasBatteriesNotifyModelBase() { super(); this.initCodecs(); } protected function initCodecs() : void { this.server = new HasBatteriesNotifyModelServer(IModel(this)); var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry)); local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(HasBatteriesNotifyCC,false))); this._setHasBatteries_hasBatteriesCodec = this._protocol.getCodec(new TypeCodecInfo(Boolean,false)); } protected function getInitParam() : HasBatteriesNotifyCC { return HasBatteriesNotifyCC(initParams[Model.object]); } override public function invoke(param1:Long, param2:ProtocolBuffer) : void { switch(param1) { case this._setHasBatteriesId: this.client.setHasBatteries(Boolean(this._setHasBatteries_hasBatteriesCodec.decode(param2))); } } override public function get id() : Long { return this.modelId; } } }
package projects.tanks.clients.fp10.libraries.tanksservices.model.serverrestarttime { public interface OnceADayActionService { function verifyAndSaveAction(param1:String) : Boolean; } }
package _codec.projects.tanks.client.entrance.model.users.pushnotification { import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import projects.tanks.client.entrance.model.users.pushnotification.NotificationClientPlatform; public class CodecNotificationClientPlatform implements ICodec { public function CodecNotificationClientPlatform() { super(); } public function init(param1:IProtocol) : void { } public function decode(param1:ProtocolBuffer) : Object { var local2:NotificationClientPlatform = null; var local3:int = int(param1.reader.readInt()); switch(local3) { case 0: local2 = NotificationClientPlatform.ANDROID; break; case 1: local2 = NotificationClientPlatform.WEB; } return local2; } public function encode(param1:ProtocolBuffer, param2:Object) : void { if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:int = int(param2.value); param1.writer.writeInt(local3); } } }
package forms.ranks { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/forms.ranks.DefaultRanksBitmaps_bitmapSmallRank07.png")] public class DefaultRanksBitmaps_bitmapSmallRank07 extends BitmapAsset { public function DefaultRanksBitmaps_bitmapSmallRank07() { super(); } } }
package alternativa.tanks.model.quest.common.gui { import alternativa.osgi.service.locale.ILocaleService; import alternativa.tanks.model.quest.common.gui.window.CommonQuestView; import alternativa.tanks.model.quest.common.gui.window.QuestEmptyItemView; import alternativa.tanks.model.quest.common.gui.window.QuestWindow; import alternativa.tanks.model.quest.common.gui.window.QuestsTabView; import alternativa.types.Long; import flash.display.Sprite; import projects.tanks.client.panel.model.quest.common.specification.QuestLevel; import projects.tanks.client.panel.model.quest.showing.QuestInfoWithLevel; public class CommonQuestTab extends QuestsTabView { [Inject] public static var localeService:ILocaleService; public static const QUEST_VIEW_WIDTH:int = 280; public static const QUEST_PANEL_HEIGHT:int = 300; public static const BUTTON_HEIGHT:int = 50; protected var itemViews:Vector.<CommonQuestView>; private var stubs:Vector.<QuestEmptyItemView>; protected var timeToNextQuestInSeconds:int; public function CommonQuestTab() { super(); this.itemViews = new Vector.<CommonQuestView>(); this.stubs = new Vector.<QuestEmptyItemView>(); } public function setTimeToNextQuest(param1:int) : void { this.timeToNextQuestInSeconds = param1; } public function initViews(param1:Vector.<QuestInfoWithLevel>) : void { var local2:QuestLevel = null; var local3:QuestInfoWithLevel = null; this.clearQuestViews(); for each(local2 in QuestLevel.values) { local3 = this.findQuestBy(local2,param1); if(local3 != null) { this.addQuestItemView(local3); } else { this.addQuestStub(local2.value); } } } protected function clearQuestViews() : void { var local1:CommonQuestView = null; var local2:QuestEmptyItemView = null; for each(local1 in this.itemViews) { this.destroyQuestView(local1); } this.itemViews.splice(0,this.itemViews.length); for each(local2 in this.stubs) { if(this.contains(local2)) { removeChild(local2); } local2.destroy(); } this.stubs.slice(0,this.stubs.length); } protected function destroyQuestView(param1:CommonQuestView) : void { removeChild(param1); param1.destroy(); } private function findQuestBy(param1:QuestLevel, param2:Vector.<QuestInfoWithLevel>) : QuestInfoWithLevel { var local3:QuestInfoWithLevel = null; for each(local3 in param2) { if(local3.level == param1) { return local3; } } return null; } protected function addQuestItemView(param1:QuestInfoWithLevel) : void { var local2:int = param1.level.value; var local3:CommonQuestView = this.createQuestView(param1); this.alignQuestView(local3,local2); this.itemViews.push(local3); addChild(local3); } protected function createQuestView(param1:QuestInfoWithLevel) : CommonQuestView { return null; } private function alignQuestView(param1:Sprite, param2:int) : void { param1.x = (QUEST_VIEW_WIDTH + QuestWindow.INNER_MARGIN - 2) * param2; param1.y = 0; } protected function addQuestStub(param1:int) : void { var local2:QuestEmptyItemView = new QuestEmptyItemView(QUEST_VIEW_WIDTH,QUEST_PANEL_HEIGHT + QuestWindow.INNER_MARGIN + BUTTON_HEIGHT,this.getTextForStubView(),this.timeToNextQuestInSeconds); this.alignQuestView(local2,param1); this.stubs.push(local2); addChild(local2); } protected function getTextForStubView() : String { return null; } public function takePrize(param1:Long) : void { var local3:CommonQuestView = null; var local2:int = 0; while(local2 < this.itemViews.length) { local3 = this.itemViews[local2]; if(local3.getQuestId() == param1) { this.itemViews.splice(local2,1); this.destroyQuestView(local3); this.addQuestStub(local3.getQuestLevel().value); break; } local2++; } } override public function close() : void { this.clearQuestViews(); } } }
package alternativa.tanks.model.profile { import projects.tanks.client.panel.model.profile.rename.AndroidRenameModelBase; import projects.tanks.client.panel.model.profile.rename.IAndroidRenameModelBase; [ModelInfo] public class AndroidRenameModel extends AndroidRenameModelBase implements IAndroidRenameModelBase { public function AndroidRenameModel() { super(); } public function renameFail() : void { } public function renameSuccessful() : void { } } }
package alternativa.tanks.utils { import alternativa.math.Vector3; public class Vector3Validator { private var vector:Vector3; private var x:EncryptedNumber; private var y:EncryptedNumber; private var z:EncryptedNumber; public function Vector3Validator(param1:Vector3) { super(); this.vector = param1; this.x = new EncryptedNumberImpl(param1.x); this.y = new EncryptedNumberImpl(param1.y); this.z = new EncryptedNumberImpl(param1.z); } public function isInvalid() : Boolean { return this.vector.x != this.x.getNumber() || this.vector.y != this.y.getNumber() || this.vector.z != this.z.getNumber(); } public function isValid() : Boolean { return !this.isInvalid(); } public function getTrace() : String { return ""; } } }
package alternativa.tanks.model.garage.resistance { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.model.garage.resistance.ResistancesIcons_artilleryResistanceClass.png")] public class ResistancesIcons_artilleryResistanceClass extends BitmapAsset { public function ResistancesIcons_artilleryResistanceClass() { super(); } } }
package forms.ranks { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/forms.ranks.PremiumRankBitmaps_bitmapSmallRank20.png")] public class PremiumRankBitmaps_bitmapSmallRank20 extends BitmapAsset { public function PremiumRankBitmaps_bitmapSmallRank20() { super(); } } }
package projects.tanks.client.partners.impl.asiasoft { import platform.client.fp10.core.resource.types.ImageResource; public class AsiasoftLoginCC { private var _facebookIcon:ImageResource; private var _googleIcon:ImageResource; private var _initialUrl:String; private var _playIdIcon:ImageResource; public function AsiasoftLoginCC(param1:ImageResource = null, param2:ImageResource = null, param3:String = null, param4:ImageResource = null) { super(); this._facebookIcon = param1; this._googleIcon = param2; this._initialUrl = param3; this._playIdIcon = param4; } public function get facebookIcon() : ImageResource { return this._facebookIcon; } public function set facebookIcon(param1:ImageResource) : void { this._facebookIcon = param1; } public function get googleIcon() : ImageResource { return this._googleIcon; } public function set googleIcon(param1:ImageResource) : void { this._googleIcon = param1; } public function get initialUrl() : String { return this._initialUrl; } public function set initialUrl(param1:String) : void { this._initialUrl = param1; } public function get playIdIcon() : ImageResource { return this._playIdIcon; } public function set playIdIcon(param1:ImageResource) : void { this._playIdIcon = param1; } public function toString() : String { var local1:String = "AsiasoftLoginCC ["; local1 += "facebookIcon = " + this.facebookIcon + " "; local1 += "googleIcon = " + this.googleIcon + " "; local1 += "initialUrl = " + this.initialUrl + " "; local1 += "playIdIcon = " + this.playIdIcon + " "; return local1 + "]"; } } }
package controls.buttons.h50px { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/controls.buttons.h50px.GreyBigButtonSkin_rightUpClass.png")] public class GreyBigButtonSkin_rightUpClass extends BitmapAsset { public function GreyBigButtonSkin_rightUpClass() { super(); } } }
package alternativa.tanks.models.weapon.laser { import alternativa.engine3d.core.Face; import alternativa.engine3d.core.Sorting; import alternativa.engine3d.core.Vertex; import alternativa.engine3d.materials.TextureMaterial; import alternativa.engine3d.objects.Mesh; import alternativa.tanks.utils.Colorizer; import flash.display.BitmapData; import flash.display.BlendMode; import flash.utils.Dictionary; import platform.client.fp10.core.type.AutoClosable; public final class Laser extends Mesh implements AutoClosable { private static const EmbedLaserRay:Class = Laser_EmbedLaserRay; private static const EmbedLaserRayBegin:Class = Laser_EmbedLaserRayBegin; private static const RAY_TEXTURE:BitmapData = new EmbedLaserRay().bitmapData; private static const RAY_TEXTURE_BEGIN:BitmapData = new EmbedLaserRayBegin().bitmapData; private static const FADE:Number = 100; private static const WIDTH:Number = 10; private static const TEX_SCALE:Number = 5; private static const SPEED:Number = 0.5; private static const SPEED_2:Number = 0.75; private static const DELTA:Number = 300; private static const colorizedRayTextures:Dictionary = new Dictionary(); private static const colorizedRayBeginTextures:Dictionary = new Dictionary(); private var material:TextureMaterial; private var a1:Vertex; private var b1:Vertex; private var c1:Vertex; private var d1:Vertex; private var e1:Vertex; private var f1:Vertex; private var g1:Vertex; private var h1:Vertex; private var rayFace1:Face; private var rayBeginFace1:Face; private var a2:Vertex; private var b2:Vertex; private var c2:Vertex; private var d2:Vertex; private var e2:Vertex; private var f2:Vertex; private var g2:Vertex; private var h2:Vertex; private var rayFace2:Face; private var rayBeginFace2:Face; private var segment:Number; private var angle:Number; private var angle2:Number; private var color:uint; public function Laser() { super(); this.a1 = addVertex(-1,1,0); this.b1 = addVertex(-1,0,0); this.c1 = addVertex(1,0,0); this.d1 = addVertex(1,1,0); this.e1 = addVertex(-1,1,0); this.f1 = addVertex(-1,0,0); this.g1 = addVertex(1,0,0); this.h1 = addVertex(1,1,0); this.rayFace1 = addQuadFace(this.a1,this.b1,this.c1,this.d1); this.rayBeginFace1 = addQuadFace(this.e1,this.f1,this.g1,this.h1); this.a2 = addVertex(-1,1,0); this.b2 = addVertex(-1,0,0); this.c2 = addVertex(1,0,0); this.d2 = addVertex(1,1,0); this.e2 = addVertex(-1,1,0); this.f2 = addVertex(-1,0,0); this.g2 = addVertex(1,0,0); this.h2 = addVertex(1,1,0); this.rayFace2 = addQuadFace(this.a2,this.b2,this.c2,this.d2); this.rayBeginFace2 = addQuadFace(this.e2,this.f2,this.g2,this.h2); calculateFacesNormals(); useLight = false; useShadowMap = false; sorting = Sorting.DYNAMIC_BSP; shadowMapAlphaThreshold = 2; depthMapAlphaThreshold = 2; blendMode = BlendMode.ADD; } public function init(param1:int) : void { this.color = param1; this.material = Colorizer.getColorizedMaterial(colorizedRayTextures,param1,RAY_TEXTURE); this.rayFace1.material = this.material; this.rayFace2.material = this.material; var local2:TextureMaterial = Colorizer.getColorizedMaterial(colorizedRayBeginTextures,param1,RAY_TEXTURE_BEGIN,false); this.rayBeginFace1.material = local2; this.rayBeginFace2.material = local2; var local3:Number = WIDTH * 0.5; this.a1.x = -local3; this.a1.u = 0; this.b1.x = -local3; this.b1.u = 0; this.c1.x = local3; this.c1.u = 1; this.d1.x = local3; this.d1.u = 1; this.e1.x = -local3; this.e1.u = 0; this.e1.v = 0; this.f1.x = -local3; this.f1.u = 0; this.f1.v = 1; this.g1.x = local3; this.g1.u = 1; this.g1.v = 1; this.h1.x = local3; this.h1.u = 1; this.h1.v = 0; this.a2.x = -local3; this.a2.u = 0; this.b2.x = -local3; this.b2.u = 0; this.c2.x = local3; this.c2.u = 1; this.d2.x = local3; this.d2.u = 1; this.e2.x = -local3; this.e2.u = 0; this.e2.v = 0; this.f2.x = -local3; this.f2.u = 0; this.f2.v = 1; this.g2.x = local3; this.g2.u = 1; this.g2.v = 1; this.h2.x = local3; this.h2.u = 1; this.h2.v = 0; this.segment = TEX_SCALE * WIDTH * this.material.texture.height / this.material.texture.width; this.angle = 0; this.angle2 = 0; } public function update(param1:int, param2:Number) : void { var local3:Number = param1 / 1000; this.a1.y = param2; this.b1.y = FADE; this.c1.y = FADE; this.d1.y = param2; this.e1.y = FADE; this.f1.y = 0; this.g1.y = 0; this.h1.y = FADE; this.a2.y = param2; this.b2.y = FADE; this.c2.y = FADE; this.d2.y = param2; this.e2.y = FADE; this.f2.y = 0; this.g2.y = 0; this.h2.y = FADE; this.angle += SPEED * local3; this.angle2 += SPEED_2 * local3; var local4:Number = Math.sin(this.angle) * DELTA; var local5:Number = Math.sin(this.angle2) * DELTA; this.a1.v = (-this.a1.y + local4) / this.segment; this.b1.v = (-this.b1.y + local4) / this.segment; this.c1.v = (-this.c1.y + local4) / this.segment; this.d1.v = (-this.d1.y + local4) / this.segment; this.a2.v = (-this.a2.y + local5) / this.segment; this.b2.v = (-this.b2.y + local5) / this.segment; this.c2.v = (-this.c2.y + local5) / this.segment; this.d2.v = (-this.d2.y + local5) / this.segment; var local6:Number = Number(this.material.texture.width); var local7:Number = Number(this.material.texture.height); var local8:Number = local6 / 2; var local9:Number = this.b1.v * local7 % local7; if(local9 < 0) { local9 = local7 + local9; } var local10:Number = (RAY_TEXTURE.getPixel(local8,local9) >> 16 & 0xFF) / 255; this.e1.v = 1 - local10; this.h1.v = 1 - local10; local9 = this.b2.v * local7 % local7; if(local9 < 0) { local9 = local7 + local9; } local10 = (RAY_TEXTURE.getPixel(local8,local9) >> 16 & 0xFF) / 255; this.e2.v = 1 - local10; this.h2.v = 1 - local10; } [Obfuscation(rename="false")] public function close() : void { if(this.color in colorizedRayTextures) { delete colorizedRayTextures[this.color]; } if(this.color in colorizedRayBeginTextures) { delete colorizedRayBeginTextures[this.color]; } this.material = null; this.rayFace1.material = null; this.rayFace2.material = null; this.rayBeginFace1.material = null; this.rayBeginFace2.material = null; } } }
package platform.client.core.general.resourcelocale.format { public class LocalizedFileFormat { private var _images:Vector.<ImagePair>; private var _strings:Vector.<StringPair>; public function LocalizedFileFormat(param1:Vector.<ImagePair> = null, param2:Vector.<StringPair> = null) { super(); this._images = param1; this._strings = param2; } public function get images() : Vector.<ImagePair> { return this._images; } public function set images(param1:Vector.<ImagePair>) : void { this._images = param1; } public function get strings() : Vector.<StringPair> { return this._strings; } public function set strings(param1:Vector.<StringPair>) : void { this._strings = param1; } public function toString() : String { var local1:String = "LocalizedFileFormat ["; local1 += "images = " + this.images + " "; local1 += "strings = " + this.strings + " "; return local1 + "]"; } } }
package com.lorentz.SVG.data.path { public class SVGCurveToCubicSmoothCommand extends SVGPathCommand { public var x2:Number = 0; public var y2:Number = 0; public var x:Number = 0; public var y:Number = 0; public var absolute:Boolean = false; public function SVGCurveToCubicSmoothCommand(absolute:Boolean, x2:Number = 0, y2:Number = 0, x:Number = 0, y:Number = 0) { super(); this.absolute = absolute; this.x2 = x2; this.y2 = y2; this.x = x; this.y = y; } override public function get type():String { return absolute ? "S" : "s"; } override public function clone():Object { var copy:SVGCurveToCubicSmoothCommand = new SVGCurveToCubicSmoothCommand(absolute); copy.x2 = x2; copy.y2 = y2; copy.x = x; copy.y = y; return copy; } } }
package alternativa.tanks.model { public interface IItemEffect { function getTimeRemaining(param1:String) : Number; } }
package alternativa.tanks.locale.ru { import mx.core.BitmapAsset; [ExcludeClass] public class Image_bitmapReferalHeader extends BitmapAsset { public function Image_bitmapReferalHeader() { super(); } } }
package alternativa.tanks.models.premium { import flash.display.BitmapData; public class PremiumIcons { private static const crownIconGreyClass:Class = PremiumIcons_crownIconGreyClass; public static const crownIconGrey:BitmapData = new crownIconGreyClass().bitmapData; public function PremiumIcons() { super(); } } }
package forms.ranks { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/forms.ranks.PremiumRankBitmaps_bitmapBigRank23.png")] public class PremiumRankBitmaps_bitmapBigRank23 extends BitmapAsset { public function PremiumRankBitmaps_bitmapBigRank23() { super(); } } }
package alternativa.tanks.utils { import alternativa.physics.collision.primitives.CollisionTriangle; public class StaticCollisionTriangleValidator extends StaticCollisionPrimitiveValidator { private var vertexValidator0:Vector3Validator; private var vertexValidator1:Vector3Validator; private var vertexValidator2:Vector3Validator; public function StaticCollisionTriangleValidator(param1:CollisionTriangle) { super(param1); this.vertexValidator0 = new Vector3Validator(param1.v0); this.vertexValidator1 = new Vector3Validator(param1.v1); this.vertexValidator2 = new Vector3Validator(param1.v2); } override public function hasIncorrectData() : Boolean { return super.hasIncorrectData() || this.vertexValidator0.isInvalid() || this.vertexValidator1.isInvalid() || this.vertexValidator2.isInvalid(); } } }
package alternativa.tanks.model.item.category { import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; import projects.tanks.client.commons.types.ItemCategoryEnum; public class IItemCategoryEvents implements IItemCategory { private var object:IGameObject; private var impl:Vector.<Object>; public function IItemCategoryEvents(param1:IGameObject, param2:Vector.<Object>) { super(); this.object = param1; this.impl = param2; } public function getCategory() : ItemCategoryEnum { var result:ItemCategoryEnum = null; var i:int = 0; var m:IItemCategory = null; try { Model.object = this.object; i = 0; while(i < this.impl.length) { m = IItemCategory(this.impl[i]); result = m.getCategory(); i++; } } finally { Model.popObject(); } return result; } } }
package alternativa.debug.dump { import alternativa.init.Main; import alternativa.osgi.service.dump.dumper.IDumper; import alternativa.register.SpaceInfo; import alternativa.service.ISpaceService; public class SpaceDumper implements IDumper { public function SpaceDumper() { super(); } public function dump(params:Vector.<String>) : String { var result:String = "\n"; var spaces:Array = ISpaceService(Main.osgi.getService(ISpaceService)).spaceList; for(var i:int = 0; i < spaces.length; i++) { result += " space id: " + (SpaceInfo(spaces[i]).id == null ? "X" : SpaceInfo(spaces[i]).id.toString()) + "\n"; } return result + "\n"; } public function get dumperName() : String { return "space"; } } }
package assets.resultwindow { import flash.display.BitmapData; [Embed(source="/_assets/assets.resultwindow.bres_NORMAL_BLUE_TL.png")] public dynamic class bres_NORMAL_BLUE_TL extends BitmapData { public function bres_NORMAL_BLUE_TL(param1:int = 4, param2:int = 4) { super(param1,param2); } } }
package alternativa.engine3d.core { import alternativa.engine3d.alternativa3d; import flash.geom.Vector3D; import flash.utils.Dictionary; use namespace alternativa3d; public class Object3DContainer extends Object3D { public var mouseChildren:Boolean = true; alternativa3d var childrenList:Object3D; alternativa3d var lightList:Light3D; alternativa3d var visibleChildren:Vector.<Object3D>; alternativa3d var numVisibleChildren:int = 0; public function Object3DContainer() { this.visibleChildren = new Vector.<Object3D>(); super(); } public function addChild(param1:Object3D) : Object3D { if(param1 == null) { throw new TypeError("Parameter child must be non-null."); } if(param1 == this) { throw new ArgumentError("An object cannot be added as a child of itself."); } var _loc2_:Object3DContainer = _parent; while(_loc2_ != null) { if(_loc2_ == param1) { throw new ArgumentError("An object cannot be added as a child to one of it\'s children (or children\'s children, etc.)."); } _loc2_ = _loc2_._parent; } if(param1._parent != null) { param1._parent.removeChild(param1); } this.addToList(param1); return param1; } public function removeChild(param1:Object3D) : Object3D { var _loc2_:Object3D = null; var _loc3_:Object3D = null; if(param1 == null) { throw new TypeError("Parameter child must be non-null."); } if(param1._parent != this) { trace("Object3DContainer::removeChild The supplied Object3D must be a child of the caller."); return null; } _loc3_ = this.childrenList; while(_loc3_ != null) { if(_loc3_ == param1) { if(_loc2_ != null) { _loc2_.next = _loc3_.next; } else { this.childrenList = _loc3_.next; } _loc3_.next = null; _loc3_.setParent(null); return param1; } _loc2_ = _loc3_; _loc3_ = _loc3_.next; } throw new ArgumentError("Cannot remove child."); } public function addChildAt(param1:Object3D, param2:int) : Object3D { if(param1 == null) { throw new TypeError("Parameter child must be non-null."); } if(param1 == this) { throw new ArgumentError("An object cannot be added as a child of itself."); } if(param2 < 0) { throw new RangeError("The supplied index is out of bounds."); } var _loc3_:Object3DContainer = _parent; while(_loc3_ != null) { if(_loc3_ == param1) { throw new ArgumentError("An object cannot be added as a child to one of it\'s children (or children\'s children, etc.)."); } _loc3_ = _loc3_._parent; } var _loc4_:Object3D = this.childrenList; var _loc5_:int = 0; while(_loc5_ < param2) { if(_loc4_ == null) { throw new RangeError("The supplied index is out of bounds."); } _loc4_ = _loc4_.next; _loc5_++; } if(param1._parent != null) { param1._parent.removeChild(param1); } this.addToList(param1,_loc4_); return param1; } public function removeChildAt(param1:int) : Object3D { if(param1 < 0) { throw new RangeError("The supplied index is out of bounds."); } var _loc2_:Object3D = this.childrenList; var _loc3_:int = 0; while(_loc3_ < param1) { if(_loc2_ == null) { throw new RangeError("The supplied index is out of bounds."); } _loc2_ = _loc2_.next; _loc3_++; } if(_loc2_ == null) { throw new RangeError("The supplied index is out of bounds."); } this.removeChild(_loc2_); return _loc2_; } public function getChildAt(param1:int) : Object3D { if(param1 < 0) { throw new RangeError("The supplied index is out of bounds."); } var _loc2_:Object3D = this.childrenList; var _loc3_:int = 0; while(_loc3_ < param1) { if(_loc2_ == null) { throw new RangeError("The supplied index is out of bounds."); } _loc2_ = _loc2_.next; _loc3_++; } if(_loc2_ == null) { throw new RangeError("The supplied index is out of bounds."); } return _loc2_; } public function getChildIndex(param1:Object3D) : int { if(param1 == null) { throw new TypeError("Parameter child must be non-null."); } if(param1._parent != this) { throw new ArgumentError("The supplied Object3D must be a child of the caller."); } var _loc2_:int = 0; var _loc3_:Object3D = this.childrenList; while(_loc3_ != null) { if(_loc3_ == param1) { return _loc2_; } _loc2_++; _loc3_ = _loc3_.next; } throw new ArgumentError("Cannot get child index."); } public function setChildIndex(param1:Object3D, param2:int) : void { if(param1 == null) { throw new TypeError("Parameter child must be non-null."); } if(param1._parent != this) { throw new ArgumentError("The supplied Object3D must be a child of the caller."); } if(param2 < 0) { throw new RangeError("The supplied index is out of bounds."); } var _loc3_:Object3D = this.childrenList; var _loc4_:int = 0; while(_loc4_ < param2) { if(_loc3_ == null) { throw new RangeError("The supplied index is out of bounds."); } _loc3_ = _loc3_.next; _loc4_++; } this.removeChild(param1); this.addToList(param1,_loc3_); } public function swapChildren(param1:Object3D, param2:Object3D) : void { var _loc3_:Object3D = null; if(param1 == null || param2 == null) { throw new TypeError("Parameter child must be non-null."); } if(param1._parent != this || param2._parent != this) { throw new ArgumentError("The supplied Object3D must be a child of the caller."); } if(param1 != param2) { if(param1.next == param2) { this.removeChild(param2); this.addToList(param2,param1); } else if(param2.next == param1) { this.removeChild(param1); this.addToList(param1,param2); } else { _loc3_ = param1.next; this.removeChild(param1); this.addToList(param1,param2); this.removeChild(param2); this.addToList(param2,_loc3_); } } } public function swapChildrenAt(param1:int, param2:int) : void { var _loc3_:int = 0; var _loc4_:Object3D = null; var _loc5_:Object3D = null; var _loc6_:Object3D = null; if(param1 < 0 || param2 < 0) { throw new RangeError("The supplied index is out of bounds."); } if(param1 != param2) { _loc4_ = this.childrenList; _loc3_ = 0; while(_loc3_ < param1) { if(_loc4_ == null) { throw new RangeError("The supplied index is out of bounds."); } _loc4_ = _loc4_.next; _loc3_++; } if(_loc4_ == null) { throw new RangeError("The supplied index is out of bounds."); } _loc5_ = this.childrenList; _loc3_ = 0; while(_loc3_ < param2) { if(_loc5_ == null) { throw new RangeError("The supplied index is out of bounds."); } _loc5_ = _loc5_.next; _loc3_++; } if(_loc5_ == null) { throw new RangeError("The supplied index is out of bounds."); } if(_loc4_ != _loc5_) { if(_loc4_.next == _loc5_) { this.removeChild(_loc5_); this.addToList(_loc5_,_loc4_); } else if(_loc5_.next == _loc4_) { this.removeChild(_loc4_); this.addToList(_loc4_,_loc5_); } else { _loc6_ = _loc4_.next; this.removeChild(_loc4_); this.addToList(_loc4_,_loc5_); this.removeChild(_loc5_); this.addToList(_loc5_,_loc6_); } } } } public function getChildByName(param1:String) : Object3D { if(param1 == null) { throw new TypeError("Parameter name must be non-null."); } var _loc2_:Object3D = this.childrenList; while(_loc2_ != null) { if(_loc2_.name == param1) { return _loc2_; } _loc2_ = _loc2_.next; } return null; } public function contains(param1:Object3D) : Boolean { if(param1 == null) { throw new TypeError("Parameter child must be non-null."); } if(param1 == this) { return true; } var _loc2_:Object3D = this.childrenList; while(_loc2_ != null) { if(_loc2_ is Object3DContainer) { if((_loc2_ as Object3DContainer).contains(param1)) { return true; } } else if(_loc2_ == param1) { return true; } _loc2_ = _loc2_.next; } return false; } public function get numChildren() : int { var _loc1_:int = 0; var _loc2_:Object3D = this.childrenList; while(_loc2_ != null) { _loc1_++; _loc2_ = _loc2_.next; } return _loc1_; } override public function intersectRay(param1:Vector3D, param2:Vector3D, param3:Dictionary = null, param4:Camera3D = null) : RayIntersectionData { var _loc5_:Vector3D = null; var _loc6_:Vector3D = null; var _loc7_:RayIntersectionData = null; var _loc10_:RayIntersectionData = null; if(param3 != null && param3[this]) { return null; } if(!boundIntersectRay(param1,param2,boundMinX,boundMinY,boundMinZ,boundMaxX,boundMaxY,boundMaxZ)) { return null; } var _loc8_:Number = 1e+22; var _loc9_:Object3D = this.childrenList; while(_loc9_ != null) { _loc9_.composeMatrix(); _loc9_.invertMatrix(); if(_loc5_ == null) { _loc5_ = new Vector3D(); _loc6_ = new Vector3D(); } _loc5_.x = _loc9_.ma * param1.x + _loc9_.mb * param1.y + _loc9_.mc * param1.z + _loc9_.md; _loc5_.y = _loc9_.me * param1.x + _loc9_.mf * param1.y + _loc9_.mg * param1.z + _loc9_.mh; _loc5_.z = _loc9_.mi * param1.x + _loc9_.mj * param1.y + _loc9_.mk * param1.z + _loc9_.ml; _loc6_.x = _loc9_.ma * param2.x + _loc9_.mb * param2.y + _loc9_.mc * param2.z; _loc6_.y = _loc9_.me * param2.x + _loc9_.mf * param2.y + _loc9_.mg * param2.z; _loc6_.z = _loc9_.mi * param2.x + _loc9_.mj * param2.y + _loc9_.mk * param2.z; _loc10_ = _loc9_.intersectRay(_loc5_,_loc6_,param3,param4); if(_loc10_ != null && _loc10_.time < _loc8_) { _loc8_ = _loc10_.time; _loc7_ = _loc10_; } _loc9_ = _loc9_.next; } return _loc7_; } override alternativa3d function checkIntersection(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number, param8:Dictionary) : Boolean { var _loc10_:Number = NaN; var _loc11_:Number = NaN; var _loc12_:Number = NaN; var _loc13_:Number = NaN; var _loc14_:Number = NaN; var _loc15_:Number = NaN; var _loc9_:Object3D = this.childrenList; while(_loc9_ != null) { if(param8 != null && !param8[_loc9_]) { _loc9_.composeMatrix(); _loc9_.invertMatrix(); _loc10_ = _loc9_.ma * param1 + _loc9_.mb * param2 + _loc9_.mc * param3 + _loc9_.md; _loc11_ = _loc9_.me * param1 + _loc9_.mf * param2 + _loc9_.mg * param3 + _loc9_.mh; _loc12_ = _loc9_.mi * param1 + _loc9_.mj * param2 + _loc9_.mk * param3 + _loc9_.ml; _loc13_ = _loc9_.ma * param4 + _loc9_.mb * param5 + _loc9_.mc * param6; _loc14_ = _loc9_.me * param4 + _loc9_.mf * param5 + _loc9_.mg * param6; _loc15_ = _loc9_.mi * param4 + _loc9_.mj * param5 + _loc9_.mk * param6; if(boundCheckIntersection(_loc10_,_loc11_,_loc12_,_loc13_,_loc14_,_loc15_,param7,_loc9_.boundMinX,_loc9_.boundMinY,_loc9_.boundMinZ,_loc9_.boundMaxX,_loc9_.boundMaxY,_loc9_.boundMaxZ) && _loc9_.checkIntersection(_loc10_,_loc11_,_loc12_,_loc13_,_loc14_,_loc15_,param7,param8)) { return true; } } _loc9_ = _loc9_.next; } return false; } override alternativa3d function collectPlanes(param1:Vector3D, param2:Vector3D, param3:Vector3D, param4:Vector3D, param5:Vector3D, param6:Vector.<Face>, param7:Dictionary = null) : void { if(param7 != null && param7[this]) { return; } var _loc8_:Vector3D = calculateSphere(param1,param2,param3,param4,param5); if(!boundIntersectSphere(_loc8_,boundMinX,boundMinY,boundMinZ,boundMaxX,boundMaxY,boundMaxZ)) { _loc8_ = null; return; } _loc8_ = null; var _loc9_:Object3D = this.childrenList; while(_loc9_ != null) { _loc9_.composeAndAppend(this); _loc9_.collectPlanes(param1,param2,param3,param4,param5,param6,param7); _loc9_ = _loc9_.next; } } override public function clone() : Object3D { var _loc1_:Object3DContainer = new Object3DContainer(); _loc1_.clonePropertiesFrom(this); return _loc1_; } override protected function clonePropertiesFrom(param1:Object3D) : void { var _loc4_:Object3D = null; var _loc5_:Object3D = null; super.clonePropertiesFrom(param1); var _loc2_:Object3DContainer = param1 as Object3DContainer; this.mouseChildren = _loc2_.mouseChildren; var _loc3_:Object3D = _loc2_.childrenList; while(_loc3_ != null) { _loc5_ = _loc3_.clone(); if(this.childrenList != null) { _loc4_.next = _loc5_; } else { this.childrenList = _loc5_; } _loc4_ = _loc5_; _loc5_.setParent(this); _loc3_ = _loc3_.next; } } override alternativa3d function draw(param1:Camera3D) : void { var _loc2_:int = 0; this.numVisibleChildren = 0; var _loc3_:Object3D = this.childrenList; while(_loc3_ != null) { if(_loc3_.visible) { _loc3_.composeAndAppend(this); if(_loc3_.cullingInCamera(param1,culling) >= 0) { _loc3_.concat(this); this.visibleChildren[this.numVisibleChildren] = _loc3_; ++this.numVisibleChildren; } } _loc3_ = _loc3_.next; } if(this.numVisibleChildren > 0) { if(param1.debug && (_loc2_ = param1.checkInDebug(this)) > 0) { if(_loc2_ & Debug.BOUNDS) { Debug.drawBounds(param1,this,boundMinX,boundMinY,boundMinZ,boundMaxX,boundMaxY,boundMaxZ); } } this.drawVisibleChildren(param1); } } alternativa3d function drawVisibleChildren(param1:Camera3D) : void { var _loc3_:Object3D = null; var _loc2_:int = this.numVisibleChildren - 1; while(_loc2_ >= 0) { _loc3_ = this.visibleChildren[_loc2_]; _loc3_.draw(param1); this.visibleChildren[_loc2_] = null; _loc2_--; } } override alternativa3d function getVG(param1:Camera3D) : VG { var _loc2_:VG = null; var _loc3_:VG = null; var _loc5_:VG = null; var _loc4_:Object3D = this.childrenList; while(_loc4_ != null) { if(_loc4_.visible) { _loc4_.composeAndAppend(this); if(_loc4_.cullingInCamera(param1,culling) >= 0) { _loc4_.concat(this); _loc5_ = _loc4_.getVG(param1); if(_loc5_ != null) { if(_loc2_ != null) { _loc3_.next = _loc5_; } else { _loc2_ = _loc5_; _loc3_ = _loc5_; } while(_loc3_.next != null) { _loc3_ = _loc3_.next; } } } } _loc4_ = _loc4_.next; } return _loc2_; } override alternativa3d function updateBounds(param1:Object3D, param2:Object3D = null) : void { var _loc3_:Object3D = this.childrenList; while(_loc3_ != null) { if(param2 != null) { _loc3_.composeAndAppend(param2); } else { _loc3_.composeMatrix(); } _loc3_.updateBounds(param1,_loc3_); _loc3_ = _loc3_.next; } } override alternativa3d function split(param1:Vector3D, param2:Vector3D, param3:Vector3D, param4:Number) : Vector.<Object3D> { var _loc10_:Object3D = null; var _loc11_:Object3D = null; var _loc13_:Object3D = null; var _loc14_:Vector3D = null; var _loc15_:Vector3D = null; var _loc16_:Vector3D = null; var _loc17_:int = 0; var _loc18_:Vector.<Object3D> = null; var _loc19_:Number = NaN; var _loc5_:Vector.<Object3D> = new Vector.<Object3D>(2); var _loc6_:Vector3D = calculatePlane(param1,param2,param3); var _loc7_:Object3D = this.childrenList; this.childrenList = null; var _loc8_:Object3DContainer = this.clone() as Object3DContainer; var _loc9_:Object3DContainer = this.clone() as Object3DContainer; var _loc12_:Object3D = _loc7_; while(_loc12_ != null) { _loc13_ = _loc12_.next; _loc12_.next = null; _loc12_.setParent(null); _loc12_.composeMatrix(); _loc12_.calculateInverseMatrix(); _loc14_ = new Vector3D(_loc12_.ima * param1.x + _loc12_.imb * param1.y + _loc12_.imc * param1.z + _loc12_.imd,_loc12_.ime * param1.x + _loc12_.imf * param1.y + _loc12_.img * param1.z + _loc12_.imh,_loc12_.imi * param1.x + _loc12_.imj * param1.y + _loc12_.imk * param1.z + _loc12_.iml); _loc15_ = new Vector3D(_loc12_.ima * param2.x + _loc12_.imb * param2.y + _loc12_.imc * param2.z + _loc12_.imd,_loc12_.ime * param2.x + _loc12_.imf * param2.y + _loc12_.img * param2.z + _loc12_.imh,_loc12_.imi * param2.x + _loc12_.imj * param2.y + _loc12_.imk * param2.z + _loc12_.iml); _loc16_ = new Vector3D(_loc12_.ima * param3.x + _loc12_.imb * param3.y + _loc12_.imc * param3.z + _loc12_.imd,_loc12_.ime * param3.x + _loc12_.imf * param3.y + _loc12_.img * param3.z + _loc12_.imh,_loc12_.imi * param3.x + _loc12_.imj * param3.y + _loc12_.imk * param3.z + _loc12_.iml); _loc17_ = _loc12_.testSplit(_loc14_,_loc15_,_loc16_,param4); if(_loc17_ < 0) { if(_loc10_ != null) { _loc10_.next = _loc12_; } else { _loc8_.childrenList = _loc12_; } _loc10_ = _loc12_; _loc12_.setParent(_loc8_); } else if(_loc17_ > 0) { if(_loc11_ != null) { _loc11_.next = _loc12_; } else { _loc9_.childrenList = _loc12_; } _loc11_ = _loc12_; _loc12_.setParent(_loc9_); } else { _loc18_ = _loc12_.split(_loc14_,_loc15_,_loc16_,param4); _loc19_ = _loc12_.distance; if(_loc18_[0] != null) { _loc12_ = _loc18_[0]; if(_loc10_ != null) { _loc10_.next = _loc12_; } else { _loc8_.childrenList = _loc12_; } _loc10_ = _loc12_; _loc12_.setParent(_loc8_); _loc12_.distance = _loc19_; } if(_loc18_[1] != null) { _loc12_ = _loc18_[1]; if(_loc11_ != null) { _loc11_.next = _loc12_; } else { _loc9_.childrenList = _loc12_; } _loc11_ = _loc12_; _loc12_.setParent(_loc9_); _loc12_.distance = _loc19_; } } _loc12_ = _loc13_; } if(_loc10_ != null) { _loc8_.calculateBounds(); _loc5_[0] = _loc8_; } if(_loc11_ != null) { _loc9_.calculateBounds(); _loc5_[1] = _loc9_; } return _loc5_; } alternativa3d function addToList(param1:Object3D, param2:Object3D = null) : void { var _loc3_:Object3D = null; param1.next = param2; param1.setParent(this); if(param2 == this.childrenList) { this.childrenList = param1; } else { _loc3_ = this.childrenList; while(_loc3_ != null) { if(_loc3_.next == param2) { _loc3_.next = param1; break; } _loc3_ = _loc3_.next; } } } override alternativa3d function setParent(param1:Object3DContainer) : void { var _loc2_:Object3DContainer = null; var _loc3_:Light3D = null; if(param1 == null) { _loc2_ = _parent; while(_loc2_._parent != null) { _loc2_ = _loc2_._parent; } if(_loc2_.lightList != null) { this.transferLights(_loc2_,this); } } else if(this.lightList != null) { _loc2_ = param1; while(_loc2_._parent != null) { _loc2_ = _loc2_._parent; } _loc3_ = this.lightList; while(_loc3_.nextLight != null) { _loc3_ = _loc3_.nextLight; } _loc3_.nextLight = _loc2_.lightList; _loc2_.lightList = this.lightList; this.lightList = null; } _parent = param1; } private function transferLights(param1:Object3DContainer, param2:Object3DContainer) : void { var _loc4_:Light3D = null; var _loc5_:Light3D = null; var _loc6_:Light3D = null; var _loc3_:Object3D = this.childrenList; while(_loc3_ != null) { if(_loc3_ is Light3D) { _loc4_ = _loc3_ as Light3D; _loc5_ = null; _loc6_ = param1.lightList; while(_loc6_ != null) { if(_loc6_ == _loc4_) { if(_loc5_ != null) { _loc5_.nextLight = _loc6_.nextLight; } else { param1.lightList = _loc6_.nextLight; } _loc6_.nextLight = param2.lightList; param2.lightList = _loc6_; break; } _loc5_ = _loc6_; _loc6_ = _loc6_.nextLight; } } else if(_loc3_ is Object3DContainer) { (_loc3_ as Object3DContainer).transferLights(param1,param2); } if(param1.lightList == null) { break; } _loc3_ = _loc3_.next; } } } }
package alternativa.tanks.model.kitoffer { import flash.events.Event; import projects.tanks.client.panel.model.kitoffer.log.KitOfferAction; public class KitOfferResultEvent extends Event { public static const CLOSE:String = "KIT_OFFER_RESULT_CLOSE_EVENT"; private var _action:KitOfferAction; public function KitOfferResultEvent(param1:KitOfferAction) { super(CLOSE); this._action = param1; } public function get action() : KitOfferAction { return this._action; } } }
package alternativa.tanks.bonuses { import platform.client.fp10.core.type.AutoClosable; public class ObjectCache { private var size:int; private var objects:Vector.<Object> = new Vector.<Object>(); public function ObjectCache() { super(); } public function put(param1:Object) : void { var local2:* = this.size++; this.objects[local2] = param1; } public function get() : Object { if(this.isEmpty()) { throw new Error(); } --this.size; var local1:Object = this.objects[this.size]; this.objects[this.size] = null; return local1; } public function isEmpty() : Boolean { return this.size == 0; } public function clear() : void { var local1:Object = null; for each(local1 in this.objects) { if(local1 is AutoClosable) { AutoClosable(local1).close(); } } this.objects.length = 0; this.size = 0; } } }
package alternativa.tanks.models.weapon.terminator { import alternativa.engine3d.materials.TextureMaterial; import alternativa.init.Main; import alternativa.math.Vector3; import alternativa.model.IModel; import alternativa.model.IObjectLoadListener; import alternativa.object.ClientObject; import alternativa.service.IModelService; import alternativa.tanks.models.battlefield.BattlefieldData; import alternativa.tanks.models.battlefield.BattlefieldModel; import alternativa.tanks.models.battlefield.IBattleField; import alternativa.tanks.models.ctf.ICTFModel; import alternativa.tanks.models.sfx.shoot.railgun.IRailgunSFXModel; import alternativa.tanks.models.tank.ITank; import alternativa.tanks.models.tank.TankData; import alternativa.tanks.models.weapon.IWeaponController; import alternativa.tanks.models.weapon.WeaponConst; import alternativa.tanks.models.weapon.WeaponUtils; import alternativa.tanks.models.weapon.common.IWeaponCommonModel; import alternativa.tanks.models.weapon.common.WeaponCommonData; import alternativa.tanks.models.weapon.shared.shot.ShotData; import alternativa.tanks.sfx.IGraphicEffect; import alternativa.tanks.sfx.ISound3DEffect; import com.alternativaplatform.projects.tanks.client.commons.types.Vector3d; import com.alternativaplatform.projects.tanks.client.models.tank.TankSpawnState; import com.alternativaplatform.projects.tanks.client.warfare.models.tankparts.weapon.terminator.ITerminatorModelBase; import com.alternativaplatform.projects.tanks.client.warfare.models.tankparts.weapon.terminator.TerminatorModelBase; import com.reygazu.anticheat.variables.SecureInt; import scpacker.networking.INetworker; import scpacker.networking.Network; import scpacker.tanks.WeaponsManager; public class TerminatorModel extends TerminatorModelBase implements IModel, ITerminatorModelBase, IWeaponController, IObjectLoadListener { private static const DECAL_RADIUS:Number = 50; private static const DECAL:Class = TerminatorModel_DECAL; private static var decalMaterial:TextureMaterial; private const INFINITY:Number = 20000; private var modelService:IModelService; private var battlefieldModel:BattlefieldModel; private var tankModel:ITank; private var commonModel:IWeaponCommonModel; private var localTankData:TankData; private var localShotData:ShotData; private var localTerminatorData:TerminatorData; private var localWeaponCommonData:WeaponCommonData; private var weaponUtils:WeaponUtils; private var _triggerPressed:Boolean; private var chargeTimeLeft:SecureInt; private var nextReadyTime:SecureInt; private var targetSystem:TerminatorTargetSystem; private var shotResult:TerminatorShotResult; private var _globalHitPosition:Vector3; private var _xAxis:Vector3; private var _globalMuzzlePosition:Vector3; private var _globalGunDirection:Vector3; private var _barrelOrigin:Vector3; private var _hitPos3d:Vector3d; private var targetPositions:Array; private var targetIncarnations:Array; private var firstshot = true; private var shotBarrel:int = 0; private var activatedTime:Number = 0; private var quickShot:Boolean; private var lock:Boolean = false; private var double:Boolean = false; private var defaultReloadMsec:int = 1; public function TerminatorModel() { this.weaponUtils = WeaponUtils.getInstance(); this.chargeTimeLeft = new SecureInt("chargeTimeLeft.value terminator"); this.nextReadyTime = new SecureInt("chargeTimeLeft.value terminator"); this.targetSystem = new TerminatorTargetSystem(); this.shotResult = new TerminatorShotResult(); this._globalHitPosition = new Vector3(); this._xAxis = new Vector3(); this._globalMuzzlePosition = new Vector3(); this._globalGunDirection = new Vector3(); this._barrelOrigin = new Vector3(); this._hitPos3d = new Vector3d(0,0,0); this.targetPositions = []; this.targetIncarnations = []; super(); _interfaces.push(IModel,ITerminatorModelBase,IWeaponController,IObjectLoadListener); this.objectLoaded(null); if(decalMaterial == null) { decalMaterial = new TextureMaterial(new DECAL().bitmapData); } } public function objectLoaded(clientObject:ClientObject) : void { if(this.commonModel == null) { this.modelService = Main.osgi.getService(IModelService) as IModelService; this.battlefieldModel = Main.osgi.getService(IBattleField) as BattlefieldModel; this.tankModel = Main.osgi.getService(ITank) as ITank; this.commonModel = Main.osgi.getService(IWeaponCommonModel) as IWeaponCommonModel; } } public function objectUnloaded(clientObject:ClientObject) : void { } public function initObject(clientObject:ClientObject, chargingTimeMsec:int, weakeningCoeff:Number) : void { var terminatorData:TerminatorData = new TerminatorData(); terminatorData.chargingTime = chargingTimeMsec; terminatorData.weakeningCoeff = weakeningCoeff; clientObject.putParams(TerminatorModel,terminatorData); this.battlefieldModel.blacklist.push(decalMaterial.getTextureResource()); this.objectLoaded(clientObject); } public function startFire(clientObject:ClientObject, firingTankId:String, barrel:int) : void { var firingTank:ClientObject = clientObject; if(firingTank == null) { return; } if(this.tankModel == null) { this.tankModel = Main.osgi.getService(ITank) as ITank; } var firingTankData:TankData = this.tankModel.getTankData(firingTank); if(firingTankData.tank == null || !firingTankData.enabled || firingTankData.local) { return; } if(this.commonModel == null) { this.commonModel = Main.osgi.getService(IWeaponCommonModel) as IWeaponCommonModel; } var commonData:WeaponCommonData = this.commonModel.getCommonData(firingTankData.turret); this.shotBarrel = barrel; this.weaponUtils.calculateGunParamsAux(firingTankData.tank.skin.turretMesh,commonData.muzzles[barrel],this._globalMuzzlePosition,this._globalGunDirection); var terminatorSfxModel:IRailgunSFXModel = WeaponsManager.getTerminatorSFX(firingTankData.turret); var terminatorData:TerminatorData = this.getTerminatorData(firingTankData.turret); var graphicEffect:IGraphicEffect = terminatorSfxModel.createChargeEffect(firingTankData.turret,firingTankData.user,commonData.muzzles[barrel],firingTankData.tank.skin.turretMesh,terminatorData.chargingTime); if(this.battlefieldModel == null) { this.battlefieldModel = Main.osgi.getService(IBattleField) as BattlefieldModel; } if(this.firstshot) { this.firstshot = false; this.battlefieldModel.addGraphicEffect(graphicEffect); graphicEffect = terminatorSfxModel.createChargeEffect(firingTankData.turret,firingTankData.user,commonData.muzzles[barrel],firingTankData.tank.skin.turretMesh,terminatorData.chargingTime); } this.battlefieldModel.addGraphicEffect(graphicEffect); var soundEffect:ISound3DEffect = terminatorSfxModel.createSoundShotEffect(firingTankData.turret,firingTankData.user,this._globalMuzzlePosition); if(soundEffect != null) { this.battlefieldModel.addSound3DEffect(soundEffect); } } public function fire(clientObject:ClientObject, firingTankId:String, affectedPoints:Array, affectedTankIds:Array, doubleShot:Boolean) : void { var firingTankData:TankData = null; var v:Vector3d = null; var graphicEffect:IGraphicEffect = null; var i:int = 0; var affectedTankObject:ClientObject = null; var affectedTankData:TankData = null; var firingTank:ClientObject = clientObject; if(firingTank == null) { return; } firingTankData = this.tankModel.getTankData(firingTank); if(firingTankData == null || firingTankData.tank == null || !firingTankData.enabled || firingTankData.local) { return; } if(this.commonModel == null) { this.commonModel = Main.osgi.getService(IWeaponCommonModel) as IWeaponCommonModel; } if(this.battlefieldModel == null) { this.battlefieldModel = Main.osgi.getService(IBattleField) as BattlefieldModel; } var commonData:WeaponCommonData = this.commonModel.getCommonData(firingTankData.turret); var terminatorData:TerminatorData = this.getTerminatorData(firingTankData.turret); this.weaponUtils.calculateGunParamsAux(firingTankData.tank.skin.turretMesh,commonData.muzzles[this.shotBarrel],this._globalMuzzlePosition,this._globalGunDirection); var numPoints:int = affectedPoints.length; var impactForce:Number = commonData.impactForce; if(affectedTankIds != null) { for(i = 0; i < numPoints - 1; i++) { affectedTankObject = BattleController.activeTanks[affectedTankIds[i]]; if(affectedTankObject != null) { affectedTankData = this.tankModel.getTankData(affectedTankObject); if(!(affectedTankData == null || affectedTankData.tank == null)) { v = affectedPoints[i]; this._globalHitPosition.x = v.x; this._globalHitPosition.y = v.y; this._globalHitPosition.z = v.z; this._globalHitPosition.vTransformBy3(affectedTankData.tank.baseMatrix); this._globalHitPosition.vAdd(affectedTankData.tank.state.pos); affectedTankData.tank.addWorldForceScaled(this._globalHitPosition,this._globalGunDirection,!!doubleShot ? Number(impactForce / 1.5) : Number(impactForce)); this.battlefieldModel.tankHit(affectedTankData,this._globalGunDirection,impactForce / WeaponConst.BASE_IMPACT_FORCE); impactForce *= terminatorData.weakeningCoeff; } } } } v = affectedPoints[numPoints - 1]; this._globalHitPosition.x = v.x; this._globalHitPosition.y = v.y; this._globalHitPosition.z = v.z; this.battlefieldModel.addDecal(this._globalHitPosition,this._globalMuzzlePosition,DECAL_RADIUS,decalMaterial); firingTankData.tank.addWorldForceScaled(this._globalMuzzlePosition,this._globalGunDirection,!!doubleShot ? Number(-commonData.kickback / 1.5) : Number(-commonData.kickback)); var terminatorSfxModel:IRailgunSFXModel = WeaponsManager.getTerminatorSFX(firingTankData.turret); var angle:Number = this._globalHitPosition.vClone().vRemove(this._globalMuzzlePosition).vNormalize().vCosAngle(this._globalGunDirection); if(angle < 0) { trace("Adding inversed ray"); graphicEffect = terminatorSfxModel.createGraphicShotEffect(firingTankData.turret,this._globalMuzzlePosition,this._globalMuzzlePosition.vClone().vScale(2).vRemove(this._globalHitPosition)); } else { graphicEffect = terminatorSfxModel.createGraphicShotEffect(firingTankData.turret,this._globalMuzzlePosition,this._globalHitPosition); } if(graphicEffect != null) { this.battlefieldModel.addGraphicEffect(graphicEffect); } } public function activateWeapon(time:int) : void { this._triggerPressed = true; } public function deactivateWeapon(time:int, sendServerCommand:Boolean) : void { this._triggerPressed = false; } public function setLocalUser(localUserData:TankData) : void { this.localTankData = localUserData; this.localShotData = WeaponsManager.shotDatas[localUserData.turret.id]; this.defaultReloadMsec = this.localShotData.reloadMsec.value; this.localTerminatorData = this.getTerminatorData(localUserData.turret); this.localWeaponCommonData = this.commonModel.getCommonData(localUserData.turret); this.battlefieldModel = Main.osgi.getService(IBattleField) as BattlefieldModel; this.targetSystem.setParams(this.battlefieldModel.getBattlefieldData().physicsScene.collisionDetector,this.localShotData.autoAimingAngleUp.value,this.localShotData.numRaysUp.value,this.localShotData.autoAimingAngleDown.value,this.localShotData.numRaysDown.value,this.localTerminatorData.weakeningCoeff,null); this.reset(); var muzzleLocalPos:Vector3 = this.localWeaponCommonData.muzzles[this.localWeaponCommonData.currBarrel]; var terminatorSfxModel:IRailgunSFXModel = WeaponsManager.getTerminatorSFX(this.localTankData.turret); var graphicEffect:IGraphicEffect = terminatorSfxModel.createChargeEffect(this.localTankData.turret,this.localTankData.user,muzzleLocalPos,this.localTankData.tank.skin.turretMesh,this.localTerminatorData.chargingTime); if(graphicEffect != null) { this.battlefieldModel.addGraphicEffect(graphicEffect); } } public function clearLocalUser() : void { this.localTankData = null; this.localShotData = null; this.localTerminatorData = null; this.localWeaponCommonData = null; } public function update(param1:int, param2:int) : Number { var _loc3_:Vector3 = null; var _loc4_:IRailgunSFXModel = null; var _loc5_:IGraphicEffect = null; var _loc6_:ISound3DEffect = null; var _loc7_:Vector3 = null; var _loc8_:IGraphicEffect = null; if(this.chargeTimeLeft.value > 0) { this.chargeTimeLeft.value -= param2; if(this.chargeTimeLeft.value <= 0) { this.chargeTimeLeft.value = 0; if(this.double) { this.doFire(this.localWeaponCommonData,this.localTankData,param1,true); this.doFire(this.localWeaponCommonData,this.localTankData,param1,true); this.double = false; } else { this.doFire(this.localWeaponCommonData,this.localTankData,param1,false); } } return this.chargeTimeLeft.value / this.localTerminatorData.chargingTime; } if(param1 < this.nextReadyTime.value) { return 1 - (this.nextReadyTime.value - param1) / this.localShotData.reloadMsec.value; } if(this._triggerPressed && TankData.localTankData.spawnState == TankSpawnState.ACTIVE && param1 > this.nextReadyTime.value) { this.activatedTime += param2; } else { if(TankData.localTankData.spawnState == TankSpawnState.ACTIVE && this.activatedTime > 0 && this.activatedTime < 1000) { this.quickShot = true; } this.activatedTime = 0; } if(this.activatedTime >= 1000) { if(!this.lock) { this.double = true; this.chargeTimeLeft.value = this.localTerminatorData.chargingTime; _loc3_ = this.localWeaponCommonData.muzzles[this.localWeaponCommonData.currBarrel]; this.weaponUtils.calculateGunParams(this.localTankData.tank.skin.turretMesh,_loc3_,this._globalMuzzlePosition,this._barrelOrigin,this._xAxis,this._globalGunDirection); _loc4_ = WeaponsManager.getTerminatorSFX(this.localTankData.turret); _loc5_ = _loc4_.createChargeEffect(this.localTankData.turret,this.localTankData.user,_loc3_,this.localTankData.tank.skin.turretMesh,this.localTerminatorData.chargingTime); if(_loc5_ != null) { this.battlefieldModel.addGraphicEffect(_loc5_); } _loc6_ = _loc4_.createSoundShotEffect(this.localTankData.turret,this.localTankData.user,this._globalMuzzlePosition); if(_loc6_ != null) { this.battlefieldModel.addSound3DEffect(_loc6_); } this.startFireCommand(this.localTankData.turret,this.localWeaponCommonData.currBarrel); this.localWeaponCommonData.currBarrel = (this.localWeaponCommonData.currBarrel + 1) % this.localWeaponCommonData.muzzles.length; _loc7_ = this.localWeaponCommonData.muzzles[this.localWeaponCommonData.currBarrel]; this.weaponUtils.calculateGunParams(this.localTankData.tank.skin.turretMesh,_loc7_,this._globalMuzzlePosition,this._barrelOrigin,this._xAxis,this._globalGunDirection); _loc8_ = _loc4_.createChargeEffect(this.localTankData.turret,this.localTankData.user,_loc7_,this.localTankData.tank.skin.turretMesh,this.localTerminatorData.chargingTime); if(_loc8_ != null) { this.battlefieldModel.addGraphicEffect(_loc8_); } this.startFireCommand(this.localTankData.turret,this.localWeaponCommonData.currBarrel); this.localShotData.reloadMsec.value = this.defaultReloadMsec * 1.75; this.activatedTime = 0; } } else if(this.quickShot) { this.chargeTimeLeft.value = this.localTerminatorData.chargingTime; _loc3_ = this.localWeaponCommonData.muzzles[this.localWeaponCommonData.currBarrel]; this.weaponUtils.calculateGunParams(this.localTankData.tank.skin.turretMesh,_loc3_,this._globalMuzzlePosition,this._barrelOrigin,this._xAxis,this._globalGunDirection); _loc4_ = WeaponsManager.getTerminatorSFX(this.localTankData.turret); _loc5_ = _loc4_.createChargeEffect(this.localTankData.turret,this.localTankData.user,_loc3_,this.localTankData.tank.skin.turretMesh,this.localTerminatorData.chargingTime); if(_loc5_ != null) { this.battlefieldModel.addGraphicEffect(_loc5_); } _loc6_ = _loc4_.createSoundShotEffect(this.localTankData.turret,this.localTankData.user,this._globalMuzzlePosition); if(_loc6_ != null) { this.battlefieldModel.addSound3DEffect(_loc6_); } this.startFireCommand(this.localTankData.turret,this.localWeaponCommonData.currBarrel); if(this.localShotData.reloadMsec.value > this.defaultReloadMsec) { this.localShotData.reloadMsec.value /= 1.75; } this.quickShot = false; this.activatedTime = 0; } return 1; } private function startFireCommand(turr:ClientObject, currBarrel:int) : void { var jsobject:Object = new Object(); jsobject.currBarrel = currBarrel; Network(Main.osgi.getService(INetworker)).send("battle;start_fire;" + JSON.stringify(jsobject)); } public function reset() : void { this.activatedTime = 0; this.chargeTimeLeft.value = 0; this.nextReadyTime.value = 0; this._triggerPressed = false; } public function stopEffects(ownerTankData:TankData) : void { } private function getTerminatorData(clientObject:ClientObject) : TerminatorData { return clientObject.getParams(TerminatorModel) as TerminatorData; } private function doFire(commonData:WeaponCommonData, tankData:TankData, time:int, double:Boolean) : void { var graphicEffect:IGraphicEffect = null; var len:int = 0; var i:int = 0; var currHitPoint:Vector3 = null; var currTankData:TankData = null; var v:Vector3 = null; this.nextReadyTime.value = time + this.localShotData.reloadMsec.value; this.weaponUtils.calculateGunParams(tankData.tank.skin.turretMesh,commonData.muzzles[commonData.currBarrel],this._globalMuzzlePosition,this._barrelOrigin,this._xAxis,this._globalGunDirection); var bfData:BattlefieldData = this.battlefieldModel.getBattlefieldData(); this.targetSystem.getTargets(tankData,this._barrelOrigin,this._globalGunDirection,this._xAxis,bfData.tanks,this.shotResult); if(this.shotResult.hitPoints.length == 0) { this._globalHitPosition.x = this._hitPos3d.x = this._globalMuzzlePosition.x + this.INFINITY * this._globalGunDirection.x; this._globalHitPosition.y = this._hitPos3d.y = this._globalMuzzlePosition.y + this.INFINITY * this._globalGunDirection.y; this._globalHitPosition.z = this._hitPos3d.z = this._globalMuzzlePosition.z + this.INFINITY * this._globalGunDirection.z; this.fireCommand(tankData.turret,null,[this._hitPos3d],null,null,this.localWeaponCommonData.currBarrel,double); this.localWeaponCommonData.currBarrel = (this.localWeaponCommonData.currBarrel + 1) % this.localWeaponCommonData.muzzles.length; } else { this._globalHitPosition.vCopy(this.shotResult.hitPoints[this.shotResult.hitPoints.length - 1]); if(this.shotResult.hitPoints.length == this.shotResult.targets.length) { this._globalHitPosition.vSubtract(this._globalMuzzlePosition).vNormalize().vScale(this.INFINITY).vAdd(this._globalMuzzlePosition); this.shotResult.hitPoints.push(this._globalHitPosition); } this.shotResult.hitPoints[this.shotResult.hitPoints.length - 1] = new Vector3d(this._globalHitPosition.x,this._globalHitPosition.y,this._globalHitPosition.z); this.targetPositions.length = 0; this.targetIncarnations.length = 0; len = this.shotResult.targets.length; for(i = 0; i < len; i++) { currHitPoint = this.shotResult.hitPoints[i]; currTankData = this.shotResult.targets[i]; currTankData.tank.addWorldForceScaled(currHitPoint,this.shotResult.dir,!!double ? Number(commonData.impactForce / 1.5) : Number(commonData.impactForce)); this.shotResult.targets[i] = currTankData.user.id; currHitPoint.vSubtract(currTankData.tank.state.pos).vTransformBy3Tr(currTankData.tank.baseMatrix); this.shotResult.hitPoints[i] = new Vector3d(currHitPoint.x,currHitPoint.y,currHitPoint.z); v = currTankData.tank.state.pos; this.targetPositions[i] = new Vector3d(v.x,v.y,v.z); this.targetIncarnations[i] = currTankData.incarnation; } if(len == 0) { this.battlefieldModel.addDecal(Vector3d(this.shotResult.hitPoints[0]).toVector3(),this._barrelOrigin,DECAL_RADIUS,decalMaterial); } else { this.battlefieldModel.addDecal(this._globalHitPosition,this._barrelOrigin,DECAL_RADIUS,decalMaterial); } this.fireCommand(tankData.turret,this.targetIncarnations,this.shotResult.hitPoints,this.shotResult.targets,this.targetPositions,this.localWeaponCommonData.currBarrel,double); this.localWeaponCommonData.currBarrel = (this.localWeaponCommonData.currBarrel + 1) % this.localWeaponCommonData.muzzles.length; } tankData.tank.addWorldForceScaled(this._globalMuzzlePosition,this._globalGunDirection,!!double ? Number(-commonData.kickback / 1.5) : Number(-commonData.kickback)); var terminatorSfxModel:IRailgunSFXModel = WeaponsManager.getTerminatorSFX(tankData.turret); var angle:Number = this._globalHitPosition.vClone().vRemove(this._globalMuzzlePosition).vNormalize().vCosAngle(this._globalGunDirection); if(angle < 0) { graphicEffect = terminatorSfxModel.createGraphicShotEffect(tankData.turret,this._globalMuzzlePosition,this._globalMuzzlePosition.vClone().vScale(2).vRemove(this._globalHitPosition)); } else { graphicEffect = terminatorSfxModel.createGraphicShotEffect(tankData.turret,this._globalMuzzlePosition,this._globalHitPosition); } if(graphicEffect != null) { this.battlefieldModel.addGraphicEffect(graphicEffect); } } public function fireCommand(turret:ClientObject, targetInc:Array, hitPoints:Array, targets:Array, targetPostitions:Array, currBarrel:int, double:Boolean) : void { var firstHitPoints:Vector3d = hitPoints[0] as Vector3d; var jsobject:Object = new Object(); jsobject.hitPoints = hitPoints; jsobject.targetInc = targetInc; jsobject.targets = targets; jsobject.currBarrel = currBarrel; jsobject.double = double; jsobject.targetPostitions = targetPostitions; jsobject.reloadTime = this.localShotData.reloadMsec.value; Network(Main.osgi.getService(INetworker)).send("battle;fire;" + JSON.stringify(jsobject)); } } }
package projects.tanks.client.battlefield.models.tankparts.weapons.machinegun { public interface IMachineGunModelBase { function reconfigureWeapon(param1:int, param2:int) : void; function setSpunState() : void; } }
package projects.tanks.client.battleservice.model.team { public class BattleTeamType { public static var NONE:BattleTeamType = new BattleTeamType("NONE"); public static var RED:BattleTeamType = new BattleTeamType("RED"); public static var BLUE:BattleTeamType = new BattleTeamType("BLUE"); private var val:String; public function BattleTeamType(value:String) { super(); this.val = value; } public static function getType(value:String) : BattleTeamType { value = value.toUpperCase(); if(value == "NONE") { return NONE; } if(value == "RED") { return RED; } if(value == "BLUE") { return BLUE; } return null; } public function toString() : String { return this.val.toLowerCase(); } public function getValue() : String { return this.val; } } }
package alternativa.engine3d.core { import alternativa.engine3d.alternativa3d; import flash.events.Event; import flash.geom.Vector3D; use namespace alternativa3d; public class MouseEvent3D extends Event { public static const CLICK:String = "click3D"; public static const DOUBLE_CLICK:String = "doubleClick3D"; public static const MOUSE_DOWN:String = "mouseDown3D"; public static const MOUSE_UP:String = "mouseUp3D"; public static const MOUSE_OVER:String = "mouseOver3D"; public static const MOUSE_OUT:String = "mouseOut3D"; public static const ROLL_OVER:String = "rollOver3D"; public static const ROLL_OUT:String = "rollOut3D"; public static const MOUSE_MOVE:String = "mouseMove3D"; public static const MOUSE_WHEEL:String = "mouseWheel3D"; public var ctrlKey:Boolean; public var altKey:Boolean; public var shiftKey:Boolean; public var buttonDown:Boolean; public var delta:int; public var relatedObject:Object3D; public var localOrigin:Vector3D = new Vector3D(); public var localDirection:Vector3D = new Vector3D(); alternativa3d var _target:Object3D; alternativa3d var _currentTarget:Object3D; alternativa3d var _bubbles:Boolean; alternativa3d var _eventPhase:uint = 3; alternativa3d var stop:Boolean = false; alternativa3d var stopImmediate:Boolean = false; public function MouseEvent3D(param1:String, param2:Boolean = true, param3:Object3D = null, param4:Boolean = false, param5:Boolean = false, param6:Boolean = false, param7:Boolean = false, param8:int = 0) { super(param1,param2); this.relatedObject = param3; this.altKey = param4; this.ctrlKey = param5; this.shiftKey = param6; this.buttonDown = param7; this.delta = param8; } alternativa3d function calculateLocalRay(param1:Number, param2:Number, param3:Object3D, param4:Camera3D) : void { param4.calculateRay(this.localOrigin,this.localDirection,param1,param2); param3.alternativa3d::composeMatrix(); var local5:Object3D = param3; while(local5.alternativa3d::_parent != null) { local5 = local5.alternativa3d::_parent; local5.alternativa3d::composeMatrix(); param3.alternativa3d::appendMatrix(local5); } param3.alternativa3d::invertMatrix(); var local6:Number = this.localOrigin.x; var local7:Number = this.localOrigin.y; var local8:Number = this.localOrigin.z; var local9:Number = this.localDirection.x; var local10:Number = this.localDirection.y; var local11:Number = this.localDirection.z; this.localOrigin.x = param3.alternativa3d::ma * local6 + param3.alternativa3d::mb * local7 + param3.alternativa3d::mc * local8 + param3.alternativa3d::md; this.localOrigin.y = param3.alternativa3d::me * local6 + param3.alternativa3d::mf * local7 + param3.alternativa3d::mg * local8 + param3.alternativa3d::mh; this.localOrigin.z = param3.alternativa3d::mi * local6 + param3.alternativa3d::mj * local7 + param3.alternativa3d::mk * local8 + param3.alternativa3d::ml; this.localDirection.x = param3.alternativa3d::ma * local9 + param3.alternativa3d::mb * local10 + param3.alternativa3d::mc * local11; this.localDirection.y = param3.alternativa3d::me * local9 + param3.alternativa3d::mf * local10 + param3.alternativa3d::mg * local11; this.localDirection.z = param3.alternativa3d::mi * local9 + param3.alternativa3d::mj * local10 + param3.alternativa3d::mk * local11; } override public function get bubbles() : Boolean { return this.alternativa3d::_bubbles; } override public function get eventPhase() : uint { return this.alternativa3d::_eventPhase; } override public function get target() : Object { return this.alternativa3d::_target; } override public function get currentTarget() : Object { return this.alternativa3d::_currentTarget; } override public function stopPropagation() : void { this.alternativa3d::stop = true; } override public function stopImmediatePropagation() : void { this.alternativa3d::stopImmediate = true; } override public function clone() : Event { return new MouseEvent3D(type,this.alternativa3d::_bubbles,this.relatedObject,this.altKey,this.ctrlKey,this.shiftKey,this.buttonDown,this.delta); } override public function toString() : String { return formatToString("MouseEvent3D","type","bubbles","eventPhase","relatedObject","altKey","ctrlKey","shiftKey","buttonDown","delta"); } } }
package projects.tanks.client.users.model.friends.accepted { import alternativa.osgi.OSGi; import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.TypeCodecInfo; import alternativa.types.Long; import platform.client.fp10.core.model.IModel; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.registry.ModelRegistry; import projects.tanks.client.users.model.friends.container.UserContainerCC; public class FriendsAcceptedModelBase extends Model { private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol)); protected var server:FriendsAcceptedModelServer; private var client:IFriendsAcceptedModelBase = IFriendsAcceptedModelBase(this); private var modelId:Long = Long.getLong(1696580544,685225790); private var _onAddingId:Long = Long.getLong(1466630272,-1977249165); private var _onAdding_userIdCodec:ICodec; private var _onRemovedId:Long = Long.getLong(1779101803,-1074606030); private var _onRemoved_userIdCodec:ICodec; public function FriendsAcceptedModelBase() { super(); this.initCodecs(); } protected function initCodecs() : void { this.server = new FriendsAcceptedModelServer(IModel(this)); var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry)); local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(UserContainerCC,false))); this._onAdding_userIdCodec = this._protocol.getCodec(new TypeCodecInfo(Long,false)); this._onRemoved_userIdCodec = this._protocol.getCodec(new TypeCodecInfo(Long,false)); } protected function getInitParam() : UserContainerCC { return UserContainerCC(initParams[Model.object]); } override public function invoke(param1:Long, param2:ProtocolBuffer) : void { switch(param1) { case this._onAddingId: this.client.onAdding(Long(this._onAdding_userIdCodec.decode(param2))); break; case this._onRemovedId: this.client.onRemoved(Long(this._onRemoved_userIdCodec.decode(param2))); } } override public function get id() : Long { return this.modelId; } } }