code
stringlengths
57
237k
package alternativa.tanks.controller.events { import flash.events.Event; public class RegisterEvent extends Event { public static const REGISTER_AFTER_CAPTCHA_CHECKED:String = "RegisterEvent.REGISTER_AFTER_CAPTCHA_CHECKED"; public static const CHECK_CAPTCHA_AND_REGISTER:String = "RegisterEvent.CHECK_CAPTCHA_AND_REGISTER"; private var _callsign:String; private var _email:String; private var _password:String; private var _rememberMe:Boolean; private var _realName:String; private var _idNumber:String; private var _captchaAnswer:String; public function RegisterEvent(param1:String, param2:String, param3:String, param4:String, param5:Boolean, param6:String, param7:String, param8:String) { super(param1); this._callsign = param2; this._email = param3; this._password = param4; this._rememberMe = param5; this._realName = param6; this._idNumber = param7; this._captchaAnswer = param8; } public function get callsign() : String { return this._callsign; } public function get password() : String { return this._password; } public function get rememberMe() : Boolean { return this._rememberMe; } public function get realName() : String { return this._realName; } public function get idNumber() : String { return this._idNumber; } public function get captchaAnswer() : String { return this._captchaAnswer; } public function get email() : String { return this._email; } } }
package projects.tanks.client.battlefield.models.effects.description { 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 EffectDescriptionModelBase extends Model { private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol)); protected var server:EffectDescriptionModelServer; private var client:IEffectDescriptionModelBase = IEffectDescriptionModelBase(this); private var modelId:Long = Long.getLong(1345545806,-1145690082); private var _activatedId:Long = Long.getLong(1368257163,-603415558); private var _activated_leftTimeInMsCodec:ICodec; private var _deactivatedId:Long = Long.getLong(635722896,-684971431); private var _mergedId:Long = Long.getLong(149694347,-1219794525); private var _merged_leftTimeInMsCodec:ICodec; public function EffectDescriptionModelBase() { super(); this.initCodecs(); } protected function initCodecs() : void { this.server = new EffectDescriptionModelServer(IModel(this)); var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry)); local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(EffectDescriptionCC,false))); this._activated_leftTimeInMsCodec = this._protocol.getCodec(new TypeCodecInfo(int,false)); this._merged_leftTimeInMsCodec = this._protocol.getCodec(new TypeCodecInfo(int,false)); } protected function getInitParam() : EffectDescriptionCC { return EffectDescriptionCC(initParams[Model.object]); } override public function invoke(param1:Long, param2:ProtocolBuffer) : void { switch(param1) { case this._activatedId: this.client.activated(int(this._activated_leftTimeInMsCodec.decode(param2))); break; case this._deactivatedId: this.client.deactivated(); break; case this._mergedId: this.client.merged(int(this._merged_leftTimeInMsCodec.decode(param2))); } } override public function get id() : Long { return this.modelId; } } }
package platform.client.fp10.core.resource { public interface IResourceLoader { function loadResource(param1:Resource, param2:IResourceLoadingListener, param3:int) : void; function removeResourceListener(param1:Resource, param2:IResourceLoadingListener) : void; function addResourceListener(param1:Resource, param2:IResourceLoadingListener) : void; } }
package projects.tanks.client.panel.model.shop.onetimepurchase { 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 ShopItemOneTimePurchaseModelBase extends Model { private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol)); protected var server:ShopItemOneTimePurchaseModelServer; private var client:IShopItemOneTimePurchaseModelBase = IShopItemOneTimePurchaseModelBase(this); private var modelId:Long = Long.getLong(1850966957,-1146243215); public function ShopItemOneTimePurchaseModelBase() { super(); this.initCodecs(); } protected function initCodecs() : void { this.server = new ShopItemOneTimePurchaseModelServer(IModel(this)); var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry)); local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(ShopItemOneTimePurchaseCC,false))); } protected function getInitParam() : ShopItemOneTimePurchaseCC { return ShopItemOneTimePurchaseCC(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.gui { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.gui.ItemInfoPanelBitmaps_bitmapLeftCenterTableKit.png")] public class ItemInfoPanelBitmaps_bitmapLeftCenterTableKit extends BitmapAsset { public function ItemInfoPanelBitmaps_bitmapLeftCenterTableKit() { super(); } } }
package alternativa.tanks.gui.friends.list.renderer.background { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.gui.friends.list.renderer.background.FriendCellSelected_rightIconClass.png")] public class FriendCellSelected_rightIconClass extends BitmapAsset { public function FriendCellSelected_rightIconClass() { super(); } } }
package alternativa.tanks.battle { public interface PhysicsInterpolator { function interpolatePhysicsState(param1:Number, param2:int) : void; } }
package controls.statassets { import assets.stat.hall_NORMAL; import flash.display.BitmapData; public class StatLineNormal extends StatLineBase { public function StatLineNormal() { super(); tl = new hall_NORMAL(1,1); px = new BitmapData(1,1,false,543488); } } }
package projects.tanks.client.battlefield.models.statistics.fps { import alternativa.osgi.OSGi; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.types.Long; import platform.client.fp10.core.model.IModel; import platform.client.fp10.core.model.impl.Model; public class FpsStatisticsModelBase extends Model { private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol)); protected var server:FpsStatisticsModelServer; private var client:IFpsStatisticsModelBase = IFpsStatisticsModelBase(this); private var modelId:Long = Long.getLong(1377034498,-1539317145); public function FpsStatisticsModelBase() { super(); this.initCodecs(); } protected function initCodecs() : void { this.server = new FpsStatisticsModelServer(IModel(this)); } 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.display.usertitle { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.display.usertitle.ProgressBarSkin_hpRightBgBlueCls.png")] public class ProgressBarSkin_hpRightBgBlueCls extends BitmapAsset { public function ProgressBarSkin_hpRightBgBlueCls() { super(); } } }
package alternativa.tanks.models.battlefield.gui.chat.cmdhandlers { import alternativa.init.Main; import alternativa.osgi.service.locale.ILocaleService; import alternativa.tanks.locale.constants.TextConst; import alternativa.tanks.models.battlefield.gui.chat.BattleChatOutput; import forms.LobbyChat; public class BlockCommandHandler implements IChatCommandHandler { private var output:BattleChatOutput; public function BlockCommandHandler(output:BattleChatOutput) { super(); this.output = output; } public function handleCommand(args:Array) : Boolean { if(args.length == 0) { return false; } var userName:String = args[0]; LobbyChat.blockUser(userName); var localeService:ILocaleService = ILocaleService(Main.osgi.getService(ILocaleService)); this.output.addSystemMessage(localeService.getText(TextConst.CHAT_PANEL_COMMAND_BLOCK,userName)); return true; } } }
package controls.statassets { import assets.stat.hall_NORMAL_ACTIVE; import flash.display.BitmapData; public class StatLineNormalActive extends StatLineBase { public function StatLineNormalActive() { super(); tl = new hall_NORMAL_ACTIVE(1,1); px = new BitmapData(1,1,false,881920); } } }
package _codec.projects.tanks.client.panel.model.quest.showing { 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.panel.model.quest.showing.QuestInfoWithLevel; public class VectorCodecQuestInfoWithLevelLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecQuestInfoWithLevelLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new TypeCodecInfo(QuestInfoWithLevel,false)); if(this.optionalElement) { this.elementCodec = new OptionalCodecDecorator(this.elementCodec); } } public function decode(param1:ProtocolBuffer) : Object { var local2:int = LengthCodecHelper.decodeLength(param1); var local3:Vector.<QuestInfoWithLevel> = new Vector.<QuestInfoWithLevel>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = QuestInfoWithLevel(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:QuestInfoWithLevel = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<QuestInfoWithLevel> = Vector.<QuestInfoWithLevel>(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.model.quest.challenge.gui { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.model.quest.challenge.gui.TierRenderer_goldenBgClass.png")] public class TierRenderer_goldenBgClass extends BitmapAsset { public function TierRenderer_goldenBgClass() { super(); } } }
package alternativa.tanks.models.service { import alternativa.tanks.gui.IClanNotificationListener; import alternativa.types.Long; import flash.events.EventDispatcher; import flash.utils.Dictionary; public class ClanUserNotificationsManager { private static var count:int; private static var incomingIndicators:Vector.<IClanNotificationListener> = new Vector.<IClanNotificationListener>(); private static var incomingNotifications:Dictionary = new Dictionary(); public static var dispatcher:EventDispatcher = new EventDispatcher(); public function ClanUserNotificationsManager() { super(); } public static function resetManager() : void { incomingIndicators = new Vector.<IClanNotificationListener>(); incomingNotifications = new Dictionary(); count = 0; } public static function addIncomingIndicatorListener(param1:IClanNotificationListener) : void { incomingIndicators.push(param1); param1.updateNotifications(); } public static function removeIncomingIndicatorListener(param1:IClanNotificationListener) : void { var local2:Number = Number(incomingIndicators.indexOf(param1)); if(local2 > 0) { incomingIndicators.splice(local2,1); } } public static function removeIncomingNotification(param1:Long) : void { if(clanInIncomingNotifications(param1)) { dispatcher.dispatchEvent(new ClanNotificationEvent(ClanNotificationEvent.REMOVE_INCOMING_NOTIFICATION,param1)); } } public static function clanInIncomingNotifications(param1:Long) : Boolean { return param1 in incomingNotifications; } public static function initializeIncomingNotifications(param1:Vector.<Long>) : void { var local2:Long = null; count = 0; for each(local2 in param1) { ++count; incomingNotifications[local2] = true; } updateAllIndicators(incomingIndicators); } public static function onIncomingNotification(param1:Long) : void { if(!(param1 in incomingNotifications)) { ++count; incomingNotifications[param1] = true; updateAllIndicators(incomingIndicators); } } public static function onRemoveIncomingNotification(param1:Long) : void { if(param1 in incomingNotifications) { --count; delete incomingNotifications[param1]; updateAllIndicators(incomingIndicators); } } public static function getIncomingNotificationsCount() : int { return count; } private static function updateAllIndicators(param1:Vector.<IClanNotificationListener>) : void { var local2:IClanNotificationListener = null; for each(local2 in param1) { local2.updateNotifications(); } } } }
package alternativa.tanks.models.battlefield.gui.statistics.field { import flash.events.Event; public class WinkingField extends IconField { protected var _value:int; protected var winkLimit:int; private var winkManager:WinkManager; public function WinkingField(winkLimit:int, iconType:int, winkManager:WinkManager) { super(iconType); this.winkLimit = winkLimit; this.winkManager = winkManager; addEventListener(Event.REMOVED_FROM_STAGE,this.onRemovedFromStage); } public function set value(value:int) : void { this._value = value; this.updateLabel(); if(this._value <= this.winkLimit) { this.startWink(); } else { this.stopWink(); } } public function startWink() : void { if(this.winkManager != null) { this.winkManager.addField(this); } } public function stopWink() : void { if(this.winkManager != null) { this.winkManager.removeField(this); } label.visible = true; } public function get textVisible() : Boolean { return label.visible; } public function set textVisible(value:Boolean) : void { label.visible = value; } protected function updateLabel() : void { text = this._value.toString(); } protected function onRemovedFromStage(e:Event) : void { this.stopWink(); } } }
package alternativa.tanks.model.payment.shop.crystal { import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; public class CrystalPackageAdapt implements CrystalPackage { private var object:IGameObject; private var impl:CrystalPackage; public function CrystalPackageAdapt(param1:IGameObject, param2:CrystalPackage) { super(); this.object = param1; this.impl = param2; } public function getPremiumDurationInDays() : int { var result:int = 0; try { Model.object = this.object; result = int(this.impl.getPremiumDurationInDays()); } finally { Model.popObject(); } return result; } } }
package _codec.projects.tanks.client.entrance.model.entrance.externalentrance { 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.CollectionCodecInfo; import alternativa.protocol.info.TypeCodecInfo; import projects.tanks.client.entrance.model.entrance.externalentrance.ExternalEntranceCC; import projects.tanks.client.entrance.model.entrance.externalentrance.SocialNetworkEntranceParams; public class CodecExternalEntranceCC implements ICodec { public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog)); private var codec_socialNetworkParams:ICodec; public function CodecExternalEntranceCC() { super(); } public function init(param1:IProtocol) : void { this.codec_socialNetworkParams = param1.getCodec(new CollectionCodecInfo(new TypeCodecInfo(SocialNetworkEntranceParams,false),false,1)); } public function decode(param1:ProtocolBuffer) : Object { var local2:ExternalEntranceCC = new ExternalEntranceCC(); local2.socialNetworkParams = this.codec_socialNetworkParams.decode(param1) as Vector.<SocialNetworkEntranceParams>; return local2; } public function encode(param1:ProtocolBuffer, param2:Object) : void { if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:ExternalEntranceCC = ExternalEntranceCC(param2); this.codec_socialNetworkParams.encode(param1,local3.socialNetworkParams); } } }
package alternativa.tanks.controller.commands { import alternativa.tanks.service.IEntranceServerFacade; import alternativa.tanks.view.events.SendChangeUidEvent; import org.robotlegs.mvcs.Command; public class SendChangeUidCommand extends Command { [Inject] public var event:SendChangeUidEvent; [Inject] public var serverFacade:IEntranceServerFacade; public function SendChangeUidCommand() { super(); } override public function execute() : void { this.serverFacade.changeUid(this.event.uid); } } }
package alternativa.tanks.gui.clanmanagement { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.gui.clanmanagement.ClanStateButton_ButtonOverRight.png")] public class ClanStateButton_ButtonOverRight extends BitmapAsset { public function ClanStateButton_ButtonOverRight() { super(); } } }
package _codec.projects.tanks.client.clans.panel.foreignclan { 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.clans.panel.foreignclan.ForeignClanData; public class VectorCodecForeignClanDataLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecForeignClanDataLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new TypeCodecInfo(ForeignClanData,false)); if(this.optionalElement) { this.elementCodec = new OptionalCodecDecorator(this.elementCodec); } } public function decode(param1:ProtocolBuffer) : Object { var local2:int = LengthCodecHelper.decodeLength(param1); var local3:Vector.<ForeignClanData> = new Vector.<ForeignClanData>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = ForeignClanData(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:ForeignClanData = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<ForeignClanData> = Vector.<ForeignClanData>(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.models.battle.gui { import alternativa.tanks.models.battle.gui.gui.statistics.field.Widget; import alternativa.tanks.models.battle.gui.gui.statistics.messages.UserAction; import alternativa.types.Long; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; import projects.tanks.client.battlefield.types.DamageType; import projects.tanks.client.battleservice.model.battle.team.BattleTeam; public class BattlefieldGUIAdapt implements BattlefieldGUI { private var object:IGameObject; private var impl:BattlefieldGUI; public function BattlefieldGUIAdapt(param1:IGameObject, param2:BattlefieldGUI) { super(); this.object = param1; this.impl = param2; } public function logUserAction(param1:Long, param2:UserAction, param3:Long) : void { var userId:Long = param1; var action:UserAction = param2; var targetUserId:Long = param3; try { Model.object = this.object; this.impl.logUserAction(userId,action,targetUserId); } finally { Model.popObject(); } } public function setIndicatorState(param1:BattleTeam, param2:int) : void { var team:BattleTeam = param1; var newState:int = param2; try { Model.object = this.object; this.impl.setIndicatorState(team,newState); } finally { Model.popObject(); } } public function setBothIndicatorsState(param1:int, param2:int) : void { var redState:int = param1; var blueState:int = param2; try { Model.object = this.object; this.impl.setBothIndicatorsState(redState,blueState); } finally { Model.popObject(); } } public function showBattleMessage(param1:uint, param2:String) : void { var color:uint = param1; var text:String = param2; try { Model.object = this.object; this.impl.showBattleMessage(color,text); } finally { Model.popObject(); } } public function showPointBattleLogMessage(param1:String, param2:UserAction) : void { var pointName:String = param1; var action:UserAction = param2; try { Model.object = this.object; this.impl.showPointBattleLogMessage(pointName,action); } finally { Model.popObject(); } } public function showUserBattleLogMessage(param1:Long, param2:UserAction) : void { var userId:Long = param1; var action:UserAction = param2; try { Model.object = this.object; this.impl.showUserBattleLogMessage(userId,action); } finally { Model.popObject(); } } public function showBattleLogMessage(param1:UserAction) : void { var action:UserAction = param1; try { Model.object = this.object; this.impl.showBattleLogMessage(action); } finally { Model.popObject(); } } public function addWidget(param1:Widget) : void { var widget:Widget = param1; try { Model.object = this.object; this.impl.addWidget(widget); } finally { Model.popObject(); } } public function logKillAction(param1:Long, param2:Long, param3:DamageType) : void { var killerId:Long = param1; var targetUserId:Long = param2; var damageType:DamageType = param3; try { Model.object = this.object; this.impl.logKillAction(killerId,targetUserId,damageType); } finally { Model.popObject(); } } } }
package alternativa.tanks.model.payment.shop.category { import projects.tanks.client.commons.types.ShopCategoryEnum; [ModelInterface] public interface ShopCategory { function getOrderIndex() : int; function isWithJumpButton() : Boolean; function getType() : ShopCategoryEnum; } }
package _codec.projects.tanks.client.panel.model.shop.paintpackage { 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.panel.model.shop.paintpackage.PaintPackageCC; public class VectorCodecPaintPackageCCLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecPaintPackageCCLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new TypeCodecInfo(PaintPackageCC,false)); if(this.optionalElement) { this.elementCodec = new OptionalCodecDecorator(this.elementCodec); } } public function decode(param1:ProtocolBuffer) : Object { var local2:int = LengthCodecHelper.decodeLength(param1); var local3:Vector.<PaintPackageCC> = new Vector.<PaintPackageCC>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = PaintPackageCC(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:PaintPackageCC = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<PaintPackageCC> = Vector.<PaintPackageCC>(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.models.weapon.plasma { import mx.core.BitmapAsset; [ExcludeClass] public class PlasmaModel_decal extends BitmapAsset { public function PlasmaModel_decal() { super(); } } }
package _codec.projects.tanks.client.battlefield.models.tankparts.weapon.common { 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.common.WeaponCommonCC; public class VectorCodecWeaponCommonCCLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecWeaponCommonCCLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new TypeCodecInfo(WeaponCommonCC,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.<WeaponCommonCC> = new Vector.<WeaponCommonCC>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = WeaponCommonCC(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:WeaponCommonCC = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<WeaponCommonCC> = Vector.<WeaponCommonCC>(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 _codec.projects.tanks.client.battlefield.models.tankparts.weapon.gauss.sfx { 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 platform.client.fp10.core.resource.types.MultiframeTextureResource; import platform.client.fp10.core.resource.types.SoundResource; import platform.client.fp10.core.resource.types.TextureResource; import projects.tanks.client.battlefield.models.tankparts.sfx.lighting.entity.LightingSFXEntity; import projects.tanks.client.battlefield.models.tankparts.weapon.gauss.sfx.GaussSFXCC; import projects.tanks.clients.flash.resources.resource.Tanks3DSResource; public class CodecGaussSFXCC implements ICodec { public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog)); private var codec_antennaDownSound:ICodec; private var codec_antennaUpSound:ICodec; private var codec_electroTexture:ICodec; private var codec_explosionElectroTexture:ICodec; private var codec_explosionTexture:ICodec; private var codec_fireTexture:ICodec; private var codec_flameTexture:ICodec; private var codec_hitMarkerTexture:ICodec; private var codec_lightingSFXEntity:ICodec; private var codec_lightningTexture:ICodec; private var codec_powerShotFarSound1:ICodec; private var codec_powerShotFarSound2:ICodec; private var codec_powerShotFarSound3:ICodec; private var codec_primaryHitSound:ICodec; private var codec_primaryShellFlightSound:ICodec; private var codec_primaryShotSound:ICodec; private var codec_secondaryHitSound:ICodec; private var codec_secondaryShotSound:ICodec; private var codec_shell:ICodec; private var codec_shellTexture:ICodec; private var codec_smokeTexture:ICodec; private var codec_startAimingSound:ICodec; private var codec_targetLockSound:ICodec; private var codec_targetLostSound:ICodec; private var codec_tracerTexture:ICodec; private var codec_trailTexture:ICodec; public function CodecGaussSFXCC() { super(); } public function init(param1:IProtocol) : void { this.codec_antennaDownSound = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_antennaUpSound = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_electroTexture = param1.getCodec(new TypeCodecInfo(TextureResource,false)); this.codec_explosionElectroTexture = param1.getCodec(new TypeCodecInfo(MultiframeTextureResource,false)); this.codec_explosionTexture = param1.getCodec(new TypeCodecInfo(MultiframeTextureResource,false)); this.codec_fireTexture = param1.getCodec(new TypeCodecInfo(TextureResource,false)); this.codec_flameTexture = param1.getCodec(new TypeCodecInfo(TextureResource,false)); this.codec_hitMarkerTexture = param1.getCodec(new TypeCodecInfo(TextureResource,false)); this.codec_lightingSFXEntity = param1.getCodec(new TypeCodecInfo(LightingSFXEntity,false)); this.codec_lightningTexture = param1.getCodec(new TypeCodecInfo(TextureResource,false)); this.codec_powerShotFarSound1 = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_powerShotFarSound2 = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_powerShotFarSound3 = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_primaryHitSound = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_primaryShellFlightSound = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_primaryShotSound = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_secondaryHitSound = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_secondaryShotSound = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_shell = param1.getCodec(new TypeCodecInfo(Tanks3DSResource,false)); this.codec_shellTexture = param1.getCodec(new TypeCodecInfo(TextureResource,false)); this.codec_smokeTexture = param1.getCodec(new TypeCodecInfo(TextureResource,false)); this.codec_startAimingSound = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_targetLockSound = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_targetLostSound = param1.getCodec(new TypeCodecInfo(SoundResource,false)); this.codec_tracerTexture = param1.getCodec(new TypeCodecInfo(TextureResource,false)); this.codec_trailTexture = param1.getCodec(new TypeCodecInfo(TextureResource,false)); } public function decode(param1:ProtocolBuffer) : Object { var local2:GaussSFXCC = new GaussSFXCC(); local2.antennaDownSound = this.codec_antennaDownSound.decode(param1) as SoundResource; local2.antennaUpSound = this.codec_antennaUpSound.decode(param1) as SoundResource; local2.electroTexture = this.codec_electroTexture.decode(param1) as TextureResource; local2.explosionElectroTexture = this.codec_explosionElectroTexture.decode(param1) as MultiframeTextureResource; local2.explosionTexture = this.codec_explosionTexture.decode(param1) as MultiframeTextureResource; local2.fireTexture = this.codec_fireTexture.decode(param1) as TextureResource; local2.flameTexture = this.codec_flameTexture.decode(param1) as TextureResource; local2.hitMarkerTexture = this.codec_hitMarkerTexture.decode(param1) as TextureResource; local2.lightingSFXEntity = this.codec_lightingSFXEntity.decode(param1) as LightingSFXEntity; local2.lightningTexture = this.codec_lightningTexture.decode(param1) as TextureResource; local2.powerShotFarSound1 = this.codec_powerShotFarSound1.decode(param1) as SoundResource; local2.powerShotFarSound2 = this.codec_powerShotFarSound2.decode(param1) as SoundResource; local2.powerShotFarSound3 = this.codec_powerShotFarSound3.decode(param1) as SoundResource; local2.primaryHitSound = this.codec_primaryHitSound.decode(param1) as SoundResource; local2.primaryShellFlightSound = this.codec_primaryShellFlightSound.decode(param1) as SoundResource; local2.primaryShotSound = this.codec_primaryShotSound.decode(param1) as SoundResource; local2.secondaryHitSound = this.codec_secondaryHitSound.decode(param1) as SoundResource; local2.secondaryShotSound = this.codec_secondaryShotSound.decode(param1) as SoundResource; local2.shell = this.codec_shell.decode(param1) as Tanks3DSResource; local2.shellTexture = this.codec_shellTexture.decode(param1) as TextureResource; local2.smokeTexture = this.codec_smokeTexture.decode(param1) as TextureResource; local2.startAimingSound = this.codec_startAimingSound.decode(param1) as SoundResource; local2.targetLockSound = this.codec_targetLockSound.decode(param1) as SoundResource; local2.targetLostSound = this.codec_targetLostSound.decode(param1) as SoundResource; local2.tracerTexture = this.codec_tracerTexture.decode(param1) as TextureResource; local2.trailTexture = this.codec_trailTexture.decode(param1) as TextureResource; return local2; } public function encode(param1:ProtocolBuffer, param2:Object) : void { if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:GaussSFXCC = GaussSFXCC(param2); this.codec_antennaDownSound.encode(param1,local3.antennaDownSound); this.codec_antennaUpSound.encode(param1,local3.antennaUpSound); this.codec_electroTexture.encode(param1,local3.electroTexture); this.codec_explosionElectroTexture.encode(param1,local3.explosionElectroTexture); this.codec_explosionTexture.encode(param1,local3.explosionTexture); this.codec_fireTexture.encode(param1,local3.fireTexture); this.codec_flameTexture.encode(param1,local3.flameTexture); this.codec_hitMarkerTexture.encode(param1,local3.hitMarkerTexture); this.codec_lightingSFXEntity.encode(param1,local3.lightingSFXEntity); this.codec_lightningTexture.encode(param1,local3.lightningTexture); this.codec_powerShotFarSound1.encode(param1,local3.powerShotFarSound1); this.codec_powerShotFarSound2.encode(param1,local3.powerShotFarSound2); this.codec_powerShotFarSound3.encode(param1,local3.powerShotFarSound3); this.codec_primaryHitSound.encode(param1,local3.primaryHitSound); this.codec_primaryShellFlightSound.encode(param1,local3.primaryShellFlightSound); this.codec_primaryShotSound.encode(param1,local3.primaryShotSound); this.codec_secondaryHitSound.encode(param1,local3.secondaryHitSound); this.codec_secondaryShotSound.encode(param1,local3.secondaryShotSound); this.codec_shell.encode(param1,local3.shell); this.codec_shellTexture.encode(param1,local3.shellTexture); this.codec_smokeTexture.encode(param1,local3.smokeTexture); this.codec_startAimingSound.encode(param1,local3.startAimingSound); this.codec_targetLockSound.encode(param1,local3.targetLockSound); this.codec_targetLostSound.encode(param1,local3.targetLostSound); this.codec_tracerTexture.encode(param1,local3.tracerTexture); this.codec_trailTexture.encode(param1,local3.trailTexture); } } }
package forms.friends { import mx.core.BitmapAsset; [ExcludeClass] public class FriendsWindowStateBigButton_ButtonOverCenter extends BitmapAsset { public function FriendsWindowStateBigButton_ButtonOverCenter() { super(); } } }
package _codec.projects.tanks.client.battlefield.models.tankparts.sfx.lighting.entity { 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 alternativa.types.Float; import projects.tanks.client.battlefield.models.tankparts.sfx.lighting.entity.LightEffectItem; public class CodecLightEffectItem implements ICodec { public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog)); private var codec_attenuationBegin:ICodec; private var codec_attenuationEnd:ICodec; private var codec_color:ICodec; private var codec_intensity:ICodec; private var codec_time:ICodec; public function CodecLightEffectItem() { super(); } public function init(param1:IProtocol) : void { this.codec_attenuationBegin = param1.getCodec(new TypeCodecInfo(Float,false)); this.codec_attenuationEnd = param1.getCodec(new TypeCodecInfo(Float,false)); this.codec_color = param1.getCodec(new TypeCodecInfo(String,false)); this.codec_intensity = param1.getCodec(new TypeCodecInfo(Float,false)); this.codec_time = param1.getCodec(new TypeCodecInfo(int,false)); } public function decode(param1:ProtocolBuffer) : Object { var local2:LightEffectItem = new LightEffectItem(); local2.attenuationBegin = this.codec_attenuationBegin.decode(param1) as Number; local2.attenuationEnd = this.codec_attenuationEnd.decode(param1) as Number; local2.color = this.codec_color.decode(param1) as String; local2.intensity = this.codec_intensity.decode(param1) as Number; local2.time = this.codec_time.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:LightEffectItem = LightEffectItem(param2); this.codec_attenuationBegin.encode(param1,local3.attenuationBegin); this.codec_attenuationEnd.encode(param1,local3.attenuationEnd); this.codec_color.encode(param1,local3.color); this.codec_intensity.encode(param1,local3.intensity); this.codec_time.encode(param1,local3.time); } } }
package projects.tanks.client.battlefield.models.tankparts.weapons.artillery { 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 WeaponRotationLimitModelServer { private var protocol:IProtocol; private var protocolBuffer:ProtocolBuffer; private var model:IModel; public function WeaponRotationLimitModelServer(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.gui.shop.indicators { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.gui.shop.indicators.ShopIndicators_iconNotificationDiscountClass.png")] public class ShopIndicators_iconNotificationDiscountClass extends BitmapAsset { public function ShopIndicators_iconNotificationDiscountClass() { super(); } } }
package projects.tanks.client.entrance.model.entrance.redirect { public interface IWarRedirectModelBase { function receiveUrl(param1:String) : void; } }
package forms.ranks { import flash.display.Bitmap; public class BigRankIcon extends RankIcon { public function BigRankIcon() { super(); } override protected function createDefaultRankBitmap(param1:int) : Bitmap { return new Bitmap(DefaultRanksBitmaps.bigRanks[param1 - 1]); } override protected function createPremiumRankBitmap(param1:int) : Bitmap { return new Bitmap(PremiumRankBitmaps.bigRanks[param1 - 1]); } } }
package alternativa.tanks.models.weapon.terminator.sfx { public class TerminatorEffectsState { public static const OPENED:int = 0; public static const CLOSED:int = 1; public static const OPENING:int = 2; public static const CLOSING:int = 3; public function TerminatorEffectsState() { super(); } } }
package projects.tanks.clients.fp10.libraries.tanksservices.service.group { import alternativa.types.Long; public interface IGroupInfoService { function addGroupUser(param1:Long) : *; function isInSameGroup(param1:Long) : Boolean; function hasGroups() : Boolean; function setHasGroups(param1:Boolean) : *; } }
package alternativa.tanks.gui.shop.payment.event { import flash.events.Event; import platform.client.fp10.core.type.IGameObject; public class PayModeChosen extends Event { public static const EVENT_TYPE:String = "PayModeChosenEVENT"; public var payMode:IGameObject; public function PayModeChosen(param1:IGameObject) { super(EVENT_TYPE,true); this.payMode = param1; } } }
package _codec.map { 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 flash.utils.Dictionary; public class String__String implements ICodec { private var keyCodec:ICodec; private var valueCodec:ICodec; private var optionalKey:Boolean; private var optionalValue:Boolean; public function String__String(param1:Boolean, param2:Boolean) { super(); this.optionalKey = param1; this.optionalValue = param2; } public function init(param1:IProtocol) : void { this.keyCodec = param1.getCodec(new TypeCodecInfo(String,false)); if(this.optionalKey) { this.keyCodec = new OptionalCodecDecorator(this.keyCodec); } this.valueCodec = param1.getCodec(new TypeCodecInfo(String,false)); if(this.optionalValue) { this.valueCodec = new OptionalCodecDecorator(this.valueCodec); } } public function decode(param1:ProtocolBuffer) : Object { var local2:int = LengthCodecHelper.decodeLength(param1); var local3:Dictionary = new Dictionary(); var local4:int = 0; while(local4 < local2) { local3[this.keyCodec.decode(param1)] = this.valueCodec.decode(param1); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local5:* = undefined; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Dictionary = Dictionary(param2); var local4:int = 0; for(local5 in local3) { local4++; } LengthCodecHelper.encodeLength(param1,local4); for(local5 in local3) { this.keyCodec.encode(param1,local5); this.valueCodec.encode(param1,local3[local5]); } } } }
package alternativa.tanks.gui.upgrade { import alternativa.tanks.gui.crystalbutton.CrystalButton; import alternativa.tanks.model.item.upgradable.UpgradableItemParams; import alternativa.tanks.model.item.upgradable.UpgradableItemPropertyValue; import alternativa.tanks.service.itempropertyparams.ItemPropertyParamsService; import alternativa.tanks.service.money.IMoneyService; import controls.TankWindowInner; import controls.buttons.h50px.GreyBigButtonSkin; import controls.buttons.skins.GoldBigButtonSkin; import controls.timer.CountDownTimer; import controls.timer.CountDownTimerOnTick; import flash.events.MouseEvent; import flash.utils.getTimer; import flash.utils.setTimeout; import projects.tanks.clients.flash.commons.services.layout.event.LobbyLayoutServiceEvent; import projects.tanks.clients.fp10.libraries.TanksLocale; import projects.tanks.clients.fp10.libraries.tanksservices.service.layout.ILobbyLayoutService; public class SelectUpgradeWindow extends UpgradeWindowBase implements CountDownTimerOnTick { [Inject] public static var moneyService:IMoneyService; [Inject] public static var propertyService:ItemPropertyParamsService; [Inject] public static var lobbyLayoutService:ILobbyLayoutService; private static const BUTTON_WIDTH:int = 136; private static const VERTICAL_MARGIN:int = 7; private static const UPGRADE_TIMEOUT_MS:int = 750; private var inner:TankWindowInner; private var properties:Vector.<UpgradableItemPropertyValue>; private var infos:Vector.<UpgradeInfoForm>; private var timer:CountDownTimer; private var upgradableItemParams:UpgradableItemParams; private var progress:UpgradeProgressForm; private var okButton:CrystalButton; public function SelectUpgradeWindow(param1:UpgradableItemParams) { var local5:UpgradeInfoForm = null; this.okButton = new CrystalButton(); this.upgradableItemParams = param1; this.properties = this.getUpgradableProperties(param1.properties); super(465,39 * this.properties.length + 152); this.inner = new TankWindowInner(440,39 * this.properties.length + 12,TankWindowInner.GREEN); this.inner.x = 12; this.inner.y = 13; addChild(this.inner); this.infos = new Vector.<UpgradeInfoForm>(this.properties.length); var local2:int = 0; var local3:int = 0; var local4:int = 0; while(local4 < this.properties.length) { local5 = new UpgradeInfoForm(param1,this.properties[local4]); local2 = Math.max(local2,local5.getValueMaxWidth()); local3 = Math.max(local3,local5.getPropertyNameWidth()); this.infos[local4] = local5; local5.y = 39 * local4 + 12; this.inner.addChild(local5); local4++; } this.infos[0].align(local3,local2); if(!param1.isFullUpgraded()) { local3 += Math.max(375 - this.infos[0].getWidth(),0); } else { local3 += Math.max(200 - this.infos[0].getWidth(),0); } for each(local5 in this.infos) { local5.align(local3,local2); } this.progress = new UpgradeProgressForm(param1); this.progress.x = 12; this.progress.y = this.inner.y + this.inner.height + VERTICAL_MARGIN; addChild(this.progress); this.okButton.width = BUTTON_WIDTH; this.okButton.addEventListener(MouseEvent.CLICK,this.onClick); this.okButton.y = this.progress.y + this.progress.height + VERTICAL_MARGIN; addChild(this.okButton); lobbyLayoutService.addEventListener(LobbyLayoutServiceEvent.END_LAYOUT_SWITCH,this.endSwitch); this.updateWidth(); this.update(); } private function getUpgradableProperties(param1:Vector.<UpgradableItemPropertyValue>) : Vector.<UpgradableItemPropertyValue> { var local2:Vector.<UpgradableItemPropertyValue> = new Vector.<UpgradableItemPropertyValue>(); var local3:int = 0; while(local3 < param1.length) { if(param1[local3].isUpgradable() || param1[local3].isVisibleInInfo()) { local2.push(param1[local3]); } local3++; } return local2; } private function updateWidth() : void { var local1:int = Math.max(200,this.infos[0].getWidth()); this.inner.width = local1; this.progress.width = local1; width = local1 + 25; } private function update() : void { var local1:UpgradeInfoForm = null; if(this.upgradableItemParams.isFullUpgraded()) { removeChild(this.okButton); this.okButton.removeEventListener(MouseEvent.CLICK,this.onClick); this.okButton = null; height = this.progress.y + this.progress.height + VERTICAL_MARGIN * 2 + cancelButton.height + 5; this.updateWidth(); } else { this.okButton.x = width - this.okButton.width >> 1; if(this.upgradableItemParams.isUpgrading()) { this.setTimer(this.upgradableItemParams.timer); } this.updateCrystalButton(); } this.progress.update(); for each(local1 in this.infos) { local1.updateForm(); } dialogService.centerDialog(this); } public function openDialog() : void { dialogService.addDialog(this); } private function setTimer(param1:CountDownTimer) : void { this.removeTimer(); this.timer = param1; this.progress.setTimer(param1); param1.addListener(CountDownTimerOnTick,this); } private function removeTimer() : void { if(this.timer != null) { this.timer.removeListener(CountDownTimerOnTick,this); this.timer = null; } } private function endSwitch(param1:LobbyLayoutServiceEvent) : void { this.updateCrystalButton(); } private function updateCrystalButton() : void { if(this.upgradableItemParams.isUpgrading()) { this.okButton.setText(localeService.getText(TanksLocale.TEXT_GARAGE_SPEED_UP_TEXT)); this.okButton.setSkin(GoldBigButtonSkin.GOLD_SKIN); this.okButton.setCost(this.upgradableItemParams.getSpeedUpPrice()); this.okButton.setSale(this.upgradableItemParams.hasSpeedUpDiscount()); } else { this.okButton.setText(localeService.getText(TanksLocale.TEXT_GARAGE_UPGRADE_TEXT)); this.okButton.setSkin(GreyBigButtonSkin.GREY_SKIN); this.okButton.setCost(this.upgradableItemParams.getStartUpgradePrice()); this.okButton.setSale(this.upgradableItemParams.hasUpgradeDiscount()); } } private function onClick(param1:MouseEvent) : void { if(this.upgradableItemParams.isUpgrading()) { this.speedUp(); return; } this.startUpgrade(); } private function speedUp() : void { var local2:CountDownTimer = null; var local1:int = int(this.okButton.getPrice()); if(moneyService.checkEnough(local1)) { this.okButton.enabled = false; local2 = this.timer; this.removeTimer(); dispatchEvent(new ItemPropertyUpgradeEvent(ItemPropertyUpgradeEvent.SPEED_UP,local2,local1)); } else { dispatchEvent(new ItemPropertyUpgradeEvent(ItemPropertyUpgradeEvent.FLUSH_UPGRADES)); } } override protected function onClose() : void { this.removeEvents(); dispatchEvent(new ItemPropertyUpgradeEvent(ItemPropertyUpgradeEvent.FLUSH_UPGRADES)); dispatchEvent(new ItemPropertyUpgradeEvent(ItemPropertyUpgradeEvent.SELECT_WINDOW_CLOSED)); dialogService.removeDialog(this); } override protected function removeEvents() : void { super.removeEvents(); lobbyLayoutService.removeEventListener(LobbyLayoutServiceEvent.END_LAYOUT_SWITCH,this.endSwitch); if(Boolean(this.okButton)) { this.okButton.removeEventListener(MouseEvent.CLICK,this.onClick); } this.removeTimer(); } private function startUpgrade() : void { var local2:CountDownTimer = null; var local1:int = int(this.okButton.getPrice()); if(moneyService.checkEnough(local1)) { local2 = new CountDownTimer(); local2.start(this.upgradableItemParams.getTimeInSeconds() * 1000 + getTimer()); this.setTimer(local2); this.okButton.enabled = false; setTimeout(this.enableOkButton,UPGRADE_TIMEOUT_MS); dispatchEvent(new ItemPropertyUpgradeEvent(ItemPropertyUpgradeEvent.UPGRADE_STARTED,local2,local1)); this.updateCrystalButton(); } else { dispatchEvent(new ItemPropertyUpgradeEvent(ItemPropertyUpgradeEvent.FLUSH_UPGRADES)); } } private function enableOkButton() : void { if(Boolean(this.okButton)) { this.updateCrystalButton(); this.okButton.enabled = true; } } public function itemUpgraded() : void { this.removeTimer(); this.update(); setTimeout(this.enableOkButton,UPGRADE_TIMEOUT_MS); } public function destroy() : void { this.removeEvents(); dialogService.removeDialog(this); } public function onTick(param1:CountDownTimer) : void { this.okButton.setCost(this.upgradableItemParams.getSpeedUpPrice()); } } }
package alternativa.tanks.gui.friends { import alternativa.tanks.gui.friends.button.friends.RequestCountIndicator; import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; public class FriendsWindowStateSmallButton extends Sprite implements FriendsWindowButtonType { private static const normalStateClass:Class = FriendsWindowStateSmallButton_normalStateClass; private static const normalStateBitmapData:BitmapData = Bitmap(new normalStateClass()).bitmapData; private static const overStateClass:Class = FriendsWindowStateSmallButton_overStateClass; private static const overStateBitmapData:BitmapData = Bitmap(new overStateClass()).bitmapData; private static const pressedStateClass:Class = FriendsWindowStateSmallButton_pressedStateClass; private static const pressedStateBitmapData:BitmapData = Bitmap(new pressedStateClass()).bitmapData; private static const inboxClass:Class = FriendsWindowStateSmallButton_inboxClass; private static const inboxBitmapData:BitmapData = Bitmap(new inboxClass()).bitmapData; private static const sentClass:Class = FriendsWindowStateSmallButton_sentClass; private static const sentBitmapData:BitmapData = Bitmap(new sentClass()).bitmapData; public static const BUTTON_WIDTH:int = 30; private static const ICON_X:int = 6; private static const ICON_Y:int = 7; private var type:FriendsWindowState; private var requestCounter:RequestCountIndicator; private var _isPressed:Boolean; private var icon:Bitmap; private var buttonNormalState:Bitmap; private var buttonOverState:Bitmap; private var buttonPressedState:Bitmap; public function FriendsWindowStateSmallButton(param1:FriendsWindowState) { super(); this.type = param1; this.buttonPressedState = new Bitmap(pressedStateBitmapData); addChild(this.buttonPressedState); this.buttonNormalState = new Bitmap(normalStateBitmapData); addChild(this.buttonNormalState); this.buttonOverState = new Bitmap(overStateBitmapData); addChild(this.buttonOverState); this.icon = new Bitmap(this.getButtonIcon()); this.icon.x = ICON_X; this.icon.y = ICON_Y; addChild(this.icon); addEventListener(MouseEvent.CLICK,this.onClick); this.isPressed = false; mouseChildren = true; mouseEnabled = true; buttonMode = true; useHandCursor = true; this.requestCounter = new RequestCountIndicator(); this.requestCounter.y = -5; addChild(this.requestCounter); } private function getButtonIcon() : BitmapData { if(this.type == FriendsWindowState.INCOMING) { return inboxBitmapData; } return sentBitmapData; } private function onClick(param1:MouseEvent) : void { this.isPressed = !this._isPressed; dispatchEvent(new Event(Event.CHANGE)); } public function destroy() : void { removeEventListener(MouseEvent.CLICK,this.onClick); if(!this._isPressed) { removeEventListener(MouseEvent.MOUSE_OVER,this.onMouseOver); removeEventListener(MouseEvent.MOUSE_OUT,this.onMouseOut); } } public function set isPressed(param1:Boolean) : void { this._isPressed = param1; if(this._isPressed) { this.icon.y = ICON_Y + 1; removeEventListener(MouseEvent.MOUSE_OVER,this.onMouseOver); removeEventListener(MouseEvent.MOUSE_OUT,this.onMouseOut); this.setState(3); } else { this.icon.y = ICON_Y; this.setState(1); addEventListener(MouseEvent.MOUSE_OVER,this.onMouseOver); addEventListener(MouseEvent.MOUSE_OUT,this.onMouseOut); } } private function setState(param1:int) : void { switch(param1) { case 1: this.buttonNormalState.visible = true; this.buttonOverState.visible = false; this.buttonPressedState.visible = false; break; case 2: this.buttonOverState.visible = true; break; case 3: this.buttonNormalState.visible = false; this.buttonOverState.visible = false; this.buttonPressedState.visible = true; } } private function onMouseOver(param1:MouseEvent) : void { this.setState(2); } private function onMouseOut(param1:MouseEvent) : void { this.setState(1); } public function setRequestCount(param1:int, param2:int) : void { this.alignRequestCounter(); this.requestCounter.setRequestCount(param1,param2); } public function set currentRequestCount(param1:int) : void { this.alignRequestCounter(); this.requestCounter.currentCount = param1; } public function set newRequestCount(param1:int) : void { this.alignRequestCounter(); this.requestCounter.newCount = param1; } private function alignRequestCounter() : void { this.requestCounter.x = BUTTON_WIDTH - this.requestCounter.width + 20; } override public function get width() : Number { return BUTTON_WIDTH; } public function getType() : FriendsWindowState { return this.type; } } }
package projects.tanks.client.partners.impl.odnoklassniki.payment { 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; public class OdnoklassnikiPaymentModelBase extends Model { private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol)); protected var server:OdnoklassnikiPaymentModelServer; private var client:IOdnoklassnikiPaymentModelBase = IOdnoklassnikiPaymentModelBase(this); private var modelId:Long = Long.getLong(1273864280,-1855777834); private var _receivePaymentTransactionId:Long = Long.getLong(801007651,-1207089136); private var _receivePaymentTransaction_shopOrderIdCodec:ICodec; private var _receivePaymentTransaction_descriptionCodec:ICodec; private var _receivePaymentTransaction_priceCodec:ICodec; public function OdnoklassnikiPaymentModelBase() { super(); this.initCodecs(); } protected function initCodecs() : void { this.server = new OdnoklassnikiPaymentModelServer(IModel(this)); this._receivePaymentTransaction_shopOrderIdCodec = this._protocol.getCodec(new TypeCodecInfo(String,false)); this._receivePaymentTransaction_descriptionCodec = this._protocol.getCodec(new TypeCodecInfo(String,false)); this._receivePaymentTransaction_priceCodec = this._protocol.getCodec(new TypeCodecInfo(String,false)); } override public function invoke(param1:Long, param2:ProtocolBuffer) : void { switch(param1) { case this._receivePaymentTransactionId: this.client.receivePaymentTransaction(String(this._receivePaymentTransaction_shopOrderIdCodec.decode(param2)),String(this._receivePaymentTransaction_descriptionCodec.decode(param2)),String(this._receivePaymentTransaction_priceCodec.decode(param2))); } } override public function get id() : Long { return this.modelId; } } }
package alternativa.math { import flash.geom.Vector3D; import flash.utils.getQualifiedClassName; import projects.tanks.client.battlefield.types.Vector3d; public class Vector3 { public static const ZERO:Vector3 = new Vector3(0,0,0); public static const X_AXIS:Vector3 = new Vector3(1,0,0); public static const Y_AXIS:Vector3 = new Vector3(0,1,0); public static const Z_AXIS:Vector3 = new Vector3(0,0,1); public static const DOWN:Vector3 = new Vector3(0,0,-1); public var x:Number; public var y:Number; public var z:Number; public function Vector3(param1:Number = 0, param2:Number = 0, param3:Number = 0) { super(); this.x = param1; this.y = param2; this.z = param3; } public static function isFiniteVector(param1:Vector3) : Boolean { return param1 != null && isFinite(param1.x) && isFinite(param1.y) && isFinite(param1.z); } public static function interpolate(param1:Number, param2:Vector3, param3:Vector3, param4:Vector3) : void { param4.x = param2.x + param1 * (param3.x - param2.x); param4.y = param2.y + param1 * (param3.y - param2.y); param4.z = param2.z + param1 * (param3.z - param2.z); } public static function distanceBetween(param1:Vector3, param2:Vector3) : Number { var local3:Number = param1.x - param2.x; var local4:Number = param1.y - param2.y; var local5:Number = param1.z - param2.z; return Math.sqrt(local3 * local3 + local4 * local4 + local5 * local5); } public static function fromVector3d(param1:Vector3d) : Vector3 { return new Vector3(param1.x,param1.y,param1.z); } public function interpolate(param1:Number, param2:Vector3, param3:Vector3) : void { this.x = param2.x + param1 * (param3.x - param2.x); this.y = param2.y + param1 * (param3.y - param2.y); this.z = param2.z + param1 * (param3.z - param2.z); } public function isFiniteVector() : Boolean { return isFinite(this.x) && isFinite(this.y) && isFinite(this.z); } public function length() : Number { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); } public function lengthSqr() : Number { return this.x * this.x + this.y * this.y + this.z * this.z; } public function setLength(param1:Number) : Vector3 { var local3:Number = NaN; var local2:Number = this.x * this.x + this.y * this.y + this.z * this.z; if(local2 == 0) { this.x = param1; } else { local3 = param1 / Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); this.x *= local3; this.y *= local3; this.z *= local3; } return this; } public function normalize() : Vector3 { var local1:Number = this.x * this.x + this.y * this.y + this.z * this.z; if(local1 == 0) { this.x = 1; } else { local1 = Math.sqrt(local1); this.x /= local1; this.y /= local1; this.z /= local1; } return this; } public function add(param1:Vector3) : Vector3 { this.x += param1.x; this.y += param1.y; this.z += param1.z; return this; } public function addScaled(param1:Number, param2:Vector3) : Vector3 { this.x += param1 * param2.x; this.y += param1 * param2.y; this.z += param1 * param2.z; return this; } public function subtract(param1:Vector3) : Vector3 { this.x -= param1.x; this.y -= param1.y; this.z -= param1.z; return this; } public function sum(param1:Vector3, param2:Vector3) : Vector3 { this.x = param1.x + param2.x; this.y = param1.y + param2.y; this.z = param1.z + param2.z; return this; } public function diff(param1:Vector3, param2:Vector3) : Vector3 { this.x = param1.x - param2.x; this.y = param1.y - param2.y; this.z = param1.z - param2.z; return this; } public function diff2d(param1:Vector3, param2:Vector3) : Vector3 { this.x = param1.x - param2.x; this.y = param1.y - param2.y; this.z = 0; return this; } public function scale(param1:Number) : Vector3 { this.x *= param1; this.y *= param1; this.z *= param1; return this; } public function reverse() : Vector3 { this.x = -this.x; this.y = -this.y; this.z = -this.z; return this; } public function dot(param1:Vector3) : Number { return this.x * param1.x + this.y * param1.y + this.z * param1.z; } public function cross(param1:Vector3) : Vector3 { var local2:Number = this.y * param1.z - this.z * param1.y; var local3:Number = this.z * param1.x - this.x * param1.z; var local4:Number = this.x * param1.y - this.y * param1.x; this.x = local2; this.y = local3; this.z = local4; return this; } public function cross2(param1:Vector3, param2:Vector3) : Vector3 { this.x = param1.y * param2.z - param1.z * param2.y; this.y = param1.z * param2.x - param1.x * param2.z; this.z = param1.x * param2.y - param1.y * param2.x; return this; } public function transform3(param1:Matrix3) : Vector3 { var local2:Number = this.x; var local3:Number = this.y; var local4:Number = this.z; this.x = param1.m00 * local2 + param1.m01 * local3 + param1.m02 * local4; this.y = param1.m10 * local2 + param1.m11 * local3 + param1.m12 * local4; this.z = param1.m20 * local2 + param1.m21 * local3 + param1.m22 * local4; return this; } public function transformTransposed3(param1:Matrix3) : Vector3 { var local2:Number = this.x; var local3:Number = this.y; var local4:Number = this.z; this.x = param1.m00 * local2 + param1.m10 * local3 + param1.m20 * local4; this.y = param1.m01 * local2 + param1.m11 * local3 + param1.m21 * local4; this.z = param1.m02 * local2 + param1.m12 * local3 + param1.m22 * local4; return this; } public function transform4(param1:Matrix4) : Vector3 { var local2:Number = this.x; var local3:Number = this.y; var local4:Number = this.z; this.x = param1.m00 * local2 + param1.m01 * local3 + param1.m02 * local4 + param1.m03; this.y = param1.m10 * local2 + param1.m11 * local3 + param1.m12 * local4 + param1.m13; this.z = param1.m20 * local2 + param1.m21 * local3 + param1.m22 * local4 + param1.m23; return this; } public function deltaTransform4(param1:Matrix4) : Vector3 { var local2:Number = this.x; var local3:Number = this.y; var local4:Number = this.z; this.x = param1.m00 * local2 + param1.m01 * local3 + param1.m02 * local4; this.y = param1.m10 * local2 + param1.m11 * local3 + param1.m12 * local4; this.z = param1.m20 * local2 + param1.m21 * local3 + param1.m22 * local4; return this; } public function transformInverse4(param1:Matrix4) : Vector3 { var local2:Number = this.x - param1.m03; var local3:Number = this.y - param1.m13; var local4:Number = this.z - param1.m23; this.x = param1.m00 * local2 + param1.m10 * local3 + param1.m20 * local4; this.y = param1.m01 * local2 + param1.m11 * local3 + param1.m21 * local4; this.z = param1.m02 * local2 + param1.m12 * local3 + param1.m22 * local4; return this; } public function transformVector4(param1:Matrix4) : Vector3 { var local2:Number = this.x; var local3:Number = this.y; var local4:Number = this.z; this.x = param1.m00 * local2 + param1.m01 * local3 + param1.m02 * local4; this.y = param1.m10 * local2 + param1.m11 * local3 + param1.m12 * local4; this.z = param1.m20 * local2 + param1.m21 * local3 + param1.m22 * local4; return this; } public function reset(param1:Number = 0, param2:Number = 0, param3:Number = 0) : Vector3 { this.x = param1; this.y = param2; this.z = param3; return this; } public function copy(param1:Vector3) : Vector3 { this.x = param1.x; this.y = param1.y; this.z = param1.z; return this; } public function clone() : Vector3 { return new Vector3(this.x,this.y,this.z); } public function toVector3D(param1:Vector3D) : Vector3D { param1.x = this.x; param1.y = this.y; param1.z = this.z; return param1; } public function copyFromVector3D(param1:Vector3D) : Vector3 { this.x = param1.x; this.y = param1.y; this.z = param1.z; return this; } public function toString() : String { return getQualifiedClassName(this) + " (" + this.x.toFixed(5) + ", " + this.y.toFixed(5) + ", " + this.z.toFixed(5) + ")"; } public function distanceToXYSquared(param1:Vector3) : Number { var local2:Number = this.x - param1.x; var local3:Number = this.y - param1.y; return local2 * local2 + local3 * local3; } public function distanceToXY(param1:Vector3) : Number { var local2:Number = this.x - param1.x; var local3:Number = this.y - param1.y; return Math.sqrt(local2 * local2 + local3 * local3); } public function distanceTo(param1:Vector3) : Number { var local2:Number = this.x - param1.x; var local3:Number = this.y - param1.y; var local4:Number = this.z - param1.z; return Math.sqrt(local2 * local2 + local3 * local3 + local4 * local4); } public function distanceToSquared(param1:Vector3) : Number { var local2:Number = this.x - param1.x; var local3:Number = this.y - param1.y; var local4:Number = this.z - param1.z; return local2 * local2 + local3 * local3 + local4 * local4; } public function setLengthAlongDirection(param1:Vector3, param2:Number) : void { var local3:Number = this.x * param1.x + this.y * param1.y + this.z * param1.z; var local4:Number = param2 - local3; this.x += local4 * param1.x; this.y += local4 * param1.y; this.z += local4 * param1.z; } public function projectOnPlane(param1:Vector3) : void { var local2:Number = this.x * param1.x + this.y * param1.y + this.z * param1.z; this.x -= local2 * param1.x; this.y -= local2 * param1.y; this.z -= local2 * param1.z; } public function toVector3d() : Vector3d { return new Vector3d(this.x,this.y,this.z); } public function copyFromVector3d(param1:Vector3d) : Vector3 { this.x = param1.x; this.y = param1.y; this.z = param1.z; return this; } public function rotationToOut(param1:Vector3, param2:Quaternion) : void { var local3:Vector3 = this.clone().cross(param1).normalize(); var local4:Number = Math.acos(this.clone().normalize().dot(param1.clone().normalize())); param2.setFromAxisAngle(local3,local4); } public function rotationTo(param1:Vector3) : Quaternion { var local2:* = new Quaternion(); this.rotationToOut(param1,local2); return local2; } } }
package platform.client.fp10.core.model.impl { import alternativa.protocol.ProtocolBuffer; import alternativa.types.Long; import flash.utils.Dictionary; import platform.client.fp10.core.model.IModel; import platform.client.fp10.core.type.IGameObject; import platform.client.fp10.core.type.IGameObjectInternal; public class Model implements IModel { private static var currentObject:IGameObject; private static var objects:Vector.<IGameObject> = new Vector.<IGameObject>(); protected var initParams:Dictionary = new Dictionary(); public function Model() { super(); } public static function get object() : IGameObject { return currentObject; } public static function set object(param1:IGameObject) : void { objects.push(currentObject); currentObject = param1; } public static function popObject() : void { currentObject = objects.pop(); } public function invoke(param1:Long, param2:ProtocolBuffer) : void { } public function get id() : Long { return null; } public function putInitParams(param1:Object) : void { this.initParams[object] = param1; } public function clearInitParams() : void { delete this.initParams[object]; } public function getData(param1:Class) : Object { return IGameObjectInternal(currentObject).getData(this,param1); } public function putData(param1:Class, param2:Object) : void { IGameObjectInternal(currentObject).putData(this,param1,param2); } public function clearData(param1:Class) : Object { return IGameObjectInternal(currentObject).clearData(this,param1); } protected function getFunctionWrapper(param1:Function) : Function { var wrapper:Function; var object:IGameObject = null; var f:Function = param1; var wrappers:Dictionary = this.getData(Model) as Dictionary; if(wrappers == null) { wrappers = new Dictionary(); this.putData(Model,wrappers); } wrapper = wrappers[f]; if(wrapper == null) { object = Model.object; wrapper = function(... rest):void { Model.object = object; f.apply(null,rest); Model.popObject(); }; wrappers[f] = wrapper; } return wrapper; } } }
package projects.tanks.client.panel.model.shop.discount { 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 ShopDiscountModelServer { private var protocol:IProtocol; private var protocolBuffer:ProtocolBuffer; private var model:IModel; public function ShopDiscountModelServer(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.gui.labels { import alternativa.tanks.gui.icons.CrystalIcon; import controls.base.LabelBase; import flash.display.Bitmap; import flash.display.Sprite; public class TextWithCrystalsSmall extends Sprite { public var label:LabelBase; public function TextWithCrystalsSmall(param1:String) { super(); mouseEnabled = false; mouseChildren = false; this.label = new LabelBase(); this.label.color = 4772391; this.label.size = 16; this.label.bold = true; this.label.text = param1; addChild(this.label); var local2:Bitmap = CrystalIcon.createSmallInstance(); local2.x = this.label.width + 1; local2.y = 5; addChild(local2); } } }
package alternativa.tanks.gui.payment.controls.exchange { import alternativa.osgi.service.locale.ILocaleService; import alternativa.tanks.calculators.IExchangeCalculator; import alternativa.tanks.gui.icons.CrystalIcon; import alternativa.tanks.gui.payment.controls.*; import alternativa.tanks.service.achievement.IAchievementService; import alternativa.tanks.service.payment.IPaymentService; import base.DiscreteSprite; import controls.base.DefaultButtonBase; import controls.base.LabelBase; import controls.numeric.NumericEditor; import controls.numeric.NumericEditorEvent; import controls.numeric.NumericStepper; import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.Sprite; import flash.events.MouseEvent; import flash.geom.Point; import flash.text.TextFieldAutoSize; import mx.utils.StringUtil; import projects.tanks.clients.fp10.libraries.TanksLocale; import projects.tanks.clients.fp10.libraries.tanksservices.service.helper.IHelpService; public class ExchangeGroup extends Sprite { [Inject] public static var localeService:ILocaleService; [Inject] public static var paymentService:IPaymentService; [Inject] public static var achievementService:IAchievementService; [Inject] public static var helperService:IHelpService; private static const BUTTON_BIG_WIDTH:int = 174; private static const BUTTON_SMALL_WIDTH:int = 100; private static const MIN_BIG_LOD_WIDTH:int = 380; private static const OUTPUT_BIG_WIDTH:Number = 174; private static const OUTPUT_SMALL_WIDTH:Number = 207; private static const INPUT_BIG_WIDTH:Number = 89; private static const INPUT_SMALL_WIDTH:Number = 157; private static const SPACE_MODULE:int = 7; private static const bitmapExchange:Class = ExchangeGroup_bitmapExchange; private static const exchangeBd:BitmapData = new bitmapExchange().bitmapData; protected var input:NumericStepper; protected var output:NumericEditor; private var crystalIcon:Bitmap; private var exchangeIcon:Bitmap; private const spaceModule:int = 3; protected var _currency:String; protected var currencyTF:LabelBase = new LabelBase(); protected var calculator:IExchangeCalculator; private var isMessagesSet:Boolean = false; private var valid:Boolean = true; private var bonusInfo:BonusLabel; private var premiumInfo:PremiumLabel; protected var proceedButton:ProceedButton; protected var backButton:DefaultButtonBase; private var calculatorContainer:Sprite; private var buttonsContainer:Sprite; private var _width:int; private var _buttonsOffset:int; private var _packagesEnabled:Boolean = true; private var _backButtonVisible:Boolean; private var _round:int; public function ExchangeGroup(param1:Boolean = false, param2:Boolean = true) { super(); this._backButtonVisible = param2; this.buttonsContainer = new DiscreteSprite(); addChild(this.buttonsContainer); this.calculatorContainer = new DiscreteSprite(); addChild(this.calculatorContainer); this.backButton = this.createBackButton(); this.buttonsContainer.addChild(this.backButton); this.backButton.visible = this._backButtonVisible; this.proceedButton = this.createProceedButton(); this.buttonsContainer.addChild(this.proceedButton); this._currency = ""; this.input = new NumericStepper(param1); this.input.setStep(10); this.calculatorContainer.addChild(this.input); this.crystalIcon = CrystalIcon.createInstance(); this.calculatorContainer.addChild(this.crystalIcon); this.exchangeIcon = new Bitmap(exchangeBd); this.calculatorContainer.addChild(this.exchangeIcon); this.output = new NumericEditor(param1); this.output.setPrecision(2); this.calculatorContainer.addChild(this.output); this.input.addEventListener(NumericEditorEvent.CHANGE,this.onInputChange); this.output.addEventListener(NumericEditorEvent.CHANGE,this.onOutputChange); this.currencyTF.autoSize = TextFieldAutoSize.LEFT; this.output.addChild(this.currencyTF); this.bonusInfo = new BonusLabel(); this.calculatorContainer.addChild(this.bonusInfo); this.premiumInfo = new PremiumLabel(); this.calculatorContainer.addChild(this.premiumInfo); } protected function createProceedButton() : ProceedButton { var local1:ProceedButton = new ProceedButton(); local1.label = localeService.getText(TanksLocale.TEXT_PAYMENT_BUTTON_PROCEED_TEXT); local1.enable = false; local1.addEventListener(MouseEvent.CLICK,this.onProceedButtonClick); return local1; } protected function createBackButton() : DefaultButtonBase { var local1:DefaultButtonBase = new DefaultButtonBase(); local1.label = localeService.getText(TanksLocale.TEXT_PAYMENT_BUTTON_BACK_TEXT); local1.addEventListener(MouseEvent.CLICK,this.onReturnButtonClick); return local1; } override public function get width() : Number { return this._width; } override public function set width(param1:Number) : void { this._width = param1; this.selectLOD(); this.calculatorContainer.x = (this._width - this.calculatorContainer.width) * 0.5; this.buttonsContainer.x = this.calculatorContainer.x; } protected function selectLOD() : void { var local1:Number = NaN; this.currencyTF.x = 0; if(this._width >= MIN_BIG_LOD_WIDTH) { this.input.setWidth(INPUT_BIG_WIDTH); local1 = this.bonusInfo.visible ? OUTPUT_BIG_WIDTH - this.bonusInfo.width - SPACE_MODULE - this.spaceModule : OUTPUT_BIG_WIDTH; this.output.setWidth(local1); this.proceedButton.width = BUTTON_BIG_WIDTH; this.backButton.width = BUTTON_BIG_WIDTH; this.crystalIcon.x = this.input.width + this.spaceModule; this.exchangeIcon.rotation = 0; this.exchangeIcon.y = (this.output.height - this.exchangeIcon.height) * 0.5; this.exchangeIcon.x = this.crystalIcon.x + this.crystalIcon.width + this.spaceModule * 2; this.output.x = this.exchangeIcon.x + this.exchangeIcon.width + this.spaceModule * 2; this.output.y = 0; } else { this.input.setWidth(INPUT_SMALL_WIDTH); local1 = this.bonusInfo.visible ? OUTPUT_SMALL_WIDTH - this.bonusInfo.width - SPACE_MODULE - this.spaceModule : OUTPUT_SMALL_WIDTH; this.output.setWidth(local1); this.proceedButton.width = BUTTON_SMALL_WIDTH; this.backButton.width = BUTTON_SMALL_WIDTH; this.crystalIcon.x = this.input.width + this.spaceModule; this.exchangeIcon.rotation = 90; this.exchangeIcon.x = (this.crystalIcon.x + this.crystalIcon.width - this.exchangeIcon.width) * 0.5; this.exchangeIcon.y = this.input.height + this.spaceModule; this.output.x = 0; this.output.y = this.exchangeIcon.y + this.exchangeIcon.height + this.spaceModule; } this.proceedButton.x = this.backButton.width + SPACE_MODULE; this.bonusInfo.x = this.output.x + this.output.width; this.bonusInfo.y = this.output.y - this.spaceModule; this.premiumInfo.x = this.bonusInfo.x + this.bonusInfo.width; this.premiumInfo.y = this.output.y + (this.output.height - this.premiumInfo.height >> 1); this.output.tf.textField.width = int(this.output.width - this.currencyTF.width - 16) - this.spaceModule; this.currencyTF.x = int(this.output.width - this.currencyTF.width - 14) - this.spaceModule; this.currencyTF.y = SPACE_MODULE; this.alignButtonsContainer(); } protected function alignButtonsContainer() : void { this.buttonsContainer.y = this.calculatorContainer.height + 18 + this._buttonsOffset; } protected function onProceedButtonClick(param1:MouseEvent) : void { stage.focus = this.proceedButton; dispatchEvent(new ExchangeGroupEvent(ExchangeGroupEvent.PROCEED)); } private function onReturnButtonClick(param1:MouseEvent) : void { dispatchEvent(new ExchangeGroupEvent(ExchangeGroupEvent.RETURN)); } public function setCalculator(param1:IExchangeCalculator) : void { this.calculator = param1; } public function recalculateBonus() : void { this.bonus = this.calculator.calculateBonus(this.output.getValue()); } public function get inputValue() : int { return this.input.intValue; } public function getCrystalsWithoutPackets(param1:Number) : int { return this.calculator.calculateCrystalsWithoutPackets(param1); } public function set inputValue(param1:int) : void { if(this.input.intValue != param1) { this.input.setValue(param1); this.outputValue = this.calculator.calculateUsingPaymentPackages(this.input.intValue); this.bonus = this.calculator.calculateBonus(this.output.getValue()); this.premiumDuration = this.calculator.calculatePremiumDuration(this.output.getValue()); } } public function set outputMinValue(param1:Number) : void { this.output.setMinValue(param1); this.input.setMinValue(this.calculator.calculateCrystalsWithoutPackets(param1)); } public function set outputMaxValue(param1:Number) : void { this.output.setMaxValue(param1); var local2:int = int(this.calculator.calculateCrystalsWithoutPackets(param1)); this.input.setMaxValue(local2); this.input.setMaxChars(local2.toString().length); } public function get outputValue() : Number { return this.output.getValue(); } public function set outputValue(param1:Number) : void { if(this._round == 0) { param1 = Math.ceil(param1); } if(this.output.getValue() != param1) { this.output.setValue(param1,false); } } public function get currency() : String { return this._currency; } public function set currency(param1:String) : void { this._currency = param1; this.currencyTF.text = this._currency; } public function set round(param1:int) : void { this._round = param1; this.output.setPrecision(param1); } protected function set bonus(param1:int) : void { if(param1 > 0) { this.bonusInfo.setCrystals(param1); } this.bonusInfo.visible = param1 > 0 && this._packagesEnabled; this.selectLOD(); } protected function set premiumDuration(param1:int) : void { if(param1 > 0) { this.premiumInfo.setPremiumDuration(param1); } this.premiumInfo.visible = param1 > 0 && this._packagesEnabled; this.selectLOD(); } protected function onInputChange(param1:NumericEditorEvent) : void { if(param1.isChangedByUser() && param1.isValid()) { this.outputValue = this.calculator.calculate(this.input.intValue); this.bonus = this.calculator.calculateBonus(this.output.getValue()); this.premiumDuration = this.calculator.calculatePremiumDuration(this.output.getValue()); paymentService.setCrystals(this.input.intValue); } this.setValid(param1.isValid()); } protected function onOutputChange(param1:NumericEditorEvent) : void { if(param1.isChangedByUser() && param1.isValid()) { this.input.setValue(this.calculator.calculateInverse(this.output.getValue())); this.bonus = this.calculator.calculateBonus(this.output.getValue()); this.premiumDuration = this.calculator.calculatePremiumDuration(this.output.getValue()); paymentService.setCrystals(this.input.intValue); } this.setValid(param1.isValid()); } protected function setValid(param1:Boolean) : void { this.valid = param1; this.proceedEnable = param1; } public function resetValue() : void { this.inputValue = paymentService.getCrystals(); this.outputValue = this.calculator.calculate(this.inputValue); this.input.selectAllIfFocused(); this.output.selectAllIfFocused(); this.valid = true; if(!this.isMessagesSet) { this.isMessagesSet = true; this.input.setGreaterMaximumMessage(paymentService.getGreaterMaximumCrystalsMessage()); this.input.setLessMinimumMessage(paymentService.getLessMinimumCrystalsMessage()); } var local1:String = paymentService.getGreaterMaximumMoneyMessage(); if(local1 != null) { this.output.setGreaterMaximumMessage(StringUtil.substitute(local1,"{0}",this.currency)); } var local2:String = paymentService.getLessMinimumMoneyMessage(); if(local2 != null) { this.output.setLessMinimumMessage(StringUtil.substitute(local2,"{0}",this.currency)); } } public function isValid() : Boolean { return this.valid; } public function get proceedEnable() : Boolean { return this.proceedButton.enable; } public function set proceedEnable(param1:Boolean) : void { this.proceedButton.enable = param1; } public function get buttonsOffset() : int { return this._buttonsOffset; } public function set buttonsOffset(param1:int) : void { if(this._buttonsOffset != param1) { this._buttonsOffset = param1; this.alignButtonsContainer(); } } public function get packagesEnabled() : Boolean { return this._packagesEnabled; } public function set packagesEnabled(param1:Boolean) : void { this._packagesEnabled = param1; this.backButton.visible = param1 && this._backButtonVisible; this.bonusInfo.visible = param1; this.premiumInfo.visible = param1; } public function calculatorWidth() : int { return this.calculatorContainer.width; } public function calculatorHeight() : int { return this.calculatorContainer.height; } public function hideButtons() : void { this.buttonsContainer.visible = false; } public function alignHelper() : Boolean { if(this.proceedEnable && parent != null && this.proceedButton.visible) { achievementService.setPaymentResumeButtonTargetPoint(this.proceedButton.localToGlobal(new Point(5,29))); return true; } return false; } } }
package alternativa.tanks.gui.payment.forms.leogaming { import flash.events.Event; public class ValidationEvent extends Event { public static const VALID:String = "ValidationEvent.VALID"; public static const INVALID:String = "ValidationEvent.INVALID"; public function ValidationEvent(param1:String, param2:Boolean = false, param3:Boolean = false) { super(param1,param2,param3); } } }
package alternativa.tanks.models.weapons.shell { import alternativa.tanks.models.weapons.discrete.DiscreteWeaponObject; import platform.client.fp10.core.type.IGameObject; public class ShellWeaponObject extends DiscreteWeaponObject { public function ShellWeaponObject(param1:IGameObject) { super(param1); } public function shellCommunication() : ShellWeaponCommunication { if(remote) { return DummyShellWeaponCommunication.INSTANCE; } return ShellWeaponCommunication(object.adapt(ShellWeaponCommunication)); } } }
package controls.dropdownlist { import controls.base.TankInputBase; import flash.events.Event; import flash.events.MouseEvent; import flash.net.SharedObject; import projects.tanks.clients.fp10.libraries.tanksservices.service.storage.IStorageService; public class AccountsList extends DropDownList { [Inject] public static var storageService:IStorageService; public static const ROW_HEIGHT:int = 20; private var dropButton:DropDownButton = new DropDownButton(); private var inputControl:TankInputBase; public function AccountsList(param1:TankInputBase) { super(); this.inputControl = param1; this.inputControl.addEventListener(Event.ADDED,this.onAdded); } private function onAdded(param1:Event) : void { this.inputControl.removeEventListener(Event.ADDED,this.onAdded); this.listBg.x = this.inputControl.x; this.listBg.y = this.inputControl.y + 28; this.inputControl.parent.addChildAt(this.listBg,this.inputControl.parent.getChildIndex(this.inputControl)); } override protected function init() : void { super.init(); list.y = 30; list.height = 100; list.rowHeight = ROW_HEIGHT; this.listBg.height = 110; removeChild(button); addChild(this.dropButton); this.dropButton.y = -1; this.dropButton.addEventListener(MouseEvent.CLICK,onButtonClick); setRenderer(AccountsRenderer); addEventListener(DeleteEvent.REMOVED,this.onAccountRemove); } public function onAccountRemove(param1:DeleteEvent) : void { list.removeItem(param1.data); close(); selectedItem = null; height = Math.min(this.length,4) * ROW_HEIGHT + 13; var local2:Object = param1.data.data; var local3:SharedObject = storageService.getAccountsStorage(); delete local3.data[local2.userName]; dispatchEvent(new Event(Event.CHANGE)); } override protected function get listBg() : DPLBackground { if(!_listBg) { _listBg = new AccountsBackground(); } return _listBg; } override public function addItem(param1:Object) : void { super.addItem(param1); height = Math.min(this.length,4) * ROW_HEIGHT + 10; } override public function set width(param1:Number) : void { this.dropButton.x = param1 - 30; super.width = param1; } override protected function draw() : void { super.draw(); list.setSize(this.listBg.width,this.listBg.height - 7); list.invalidate(); } public function get length() : Number { return dp.length; } public function initialize() : void { var local3:String = null; var local4:SharedObject = null; clear(); var local1:SharedObject = storageService.getAccountsStorage(); var local2:int = 0; for(local3 in local1.data) { if(Boolean(local1.data[local3].userHash)) { this.addItem({ "gameName":local3, "rang":0, "id":local2++, "data":local1.data[local3] }); } } visible = local2 > 0; local4 = storageService.getStorage(); if(Boolean(local4.data.userName)) { selectItemByField("gameName",local4.data.userName); } else { selectItemByField("id",0); } } } }
package alternativa.tanks.models.battle.battlefield.map { import alternativa.engine3d.core.Object3D; import alternativa.engine3d.core.Sorting; import alternativa.engine3d.objects.BSP; import alternativa.engine3d.objects.Mesh; import alternativa.engine3d.objects.Occluder; import alternativa.engine3d.objects.Sprite3D; import alternativa.physics.collision.types.AABB; import alternativa.proplib.PropLibRegistry; import alternativa.proplib.PropLibrary; import alternativa.proplib.objects.PropMesh; import alternativa.proplib.objects.PropObject; import alternativa.proplib.objects.PropSprite; import alternativa.proplib.types.PropData; import alternativa.proplib.types.PropGroup; import alternativa.tanks.battle.scene3d.Object3DNames; import alternativa.utils.clearDictionary; import flash.geom.Matrix3D; import flash.geom.Vector3D; import flash.utils.Dictionary; public class MapGeometryParser { private static const objectMatrix:Matrix3D = new Matrix3D(); private static const components:Vector.<Vector3D> = Vector.<Vector3D>([new Vector3D(),new Vector3D(),new Vector3D(1,1,1)]); private var propLibRegistry:PropLibRegistry; private var texturedPropsRegistry:TexturedPropsRegistry = new TexturedPropsRegistry(); private var objects:Vector.<Object3D> = new Vector.<Object3D>(); private var sprites:Vector.<Object3D> = new Vector.<Object3D>(); private var occluders:Vector.<Occluder> = new Vector.<Occluder>(); private var billboards:Vector.<Mesh> = new Vector.<Mesh>(); private var meshProps:Vector.<Object3D> = new Vector.<Object3D>(); private var propObjectByMesh:Dictionary = new Dictionary(); private var textureNameByMesh:Dictionary = new Dictionary(); private var mapBounds:AABB = new AABB(); private var normalsCalculator:NormalsCalculator = new NormalsCalculator(); private var christmasTree:Object3D; private var christmasTreeToys:Vector.<Object3D> = new Vector.<Object3D>(); public function MapGeometryParser(param1:PropLibRegistry) { super(); this.propLibRegistry = param1; } private static function getPropTextureName(param1:XML) : String { var local2:String = null; var local3:XMLList = param1.elements("texture-name"); if(local3.length() > 0) { local2 = local3[0]; } return local2 || PropMesh.DEFAULT_TEXTURE; } private static function readVector3D(param1:XMLList, param2:Vector3D) : void { var local3:XML = null; if(param1.length() > 0) { local3 = param1[0]; param2.x = parseFloat(local3.x); param2.y = parseFloat(local3.y); param2.z = parseFloat(local3.z); } else { param2.x = param2.y = param2.z = 0; } } public function parse(param1:XML) : void { this.parseProps(param1); this.normalsCalculator.calculateNormals(this.meshProps); if(this.christmasTree != null) { (this.christmasTree as Mesh).calculateVerticesNormalsByAngle(Math.PI / 3,1); } this.makeBSPs(); } private function parseProps(param1:XML) : void { var local2:XML = null; for each(local2 in param1.elements("static-geometry").prop) { this.parseProp(local2); } } private function parseProp(param1:XML) : void { var local2:PropObject = this.getPropObject(param1); if(local2 != null) { if(local2 is PropMesh) { this.parseMesh(param1,PropMesh(local2)); } else if(local2 is PropSprite) { this.parseSprite(param1,PropSprite(local2)); } } } private function getPropObject(param1:XML) : PropObject { var local2:String = param1.attribute("library-name"); var local3:String = param1.attribute("group-name"); var local4:String = param1.@name; var local5:PropLibrary = this.propLibRegistry.getLibrary(local2); if(local5 == null) { return null; } var local6:PropGroup = local5.rootGroup.getGroupByName(local3); if(local6 == null) { return null; } var local7:PropData = local6.getPropByName(local4); if(local7 == null) { return null; } return local7.getDefaultState().getDefaultObject(); } private function parseMesh(param1:XML, param2:PropMesh) : void { if(param1.@name == "Billboard") { this.parseBillboard(param1,param2); } else { this.parseMeshProp(param1,param2); } } private function parseBillboard(param1:XML, param2:PropMesh) : void { var local3:Mesh = null; local3 = Mesh(param2.object.clone()); local3.calculateFacesNormals(); local3.calculateVerticesNormalsByAngle(0); local3.sorting = Sorting.DYNAMIC_BSP; local3.name = Object3DNames.STATIC; this.billboards.push(local3); var local4:String = getPropTextureName(param1); this.texturedPropsRegistry.addMesh(param2,local4,local3,"display"); var local5:Vector3D = components[0]; readVector3D(param1.position,local5); this.mapBounds.addPoint(local5.x,local5.y,local5.z); var local6:Vector3D = components[1]; readVector3D(param1.rotation,local6); local3.x = local5.x; local3.y = local5.y; local3.z = local5.z; local3.rotationZ = local6.z; this.objects.push(local3); } private function parseMeshProp(param1:XML, param2:PropMesh) : void { var local3:Mesh = Mesh(param2.object.clone()); var local4:Vector3D = components[0]; readVector3D(param1.position,local4); local3.x = local4.x; local3.y = local4.y; local3.z = local4.z; this.mapBounds.addPoint(local4.x,local4.y,local4.z); var local5:Vector3D = components[1]; readVector3D(param1.rotation,local5); local3.rotationZ = local5.z; var local6:String = getPropTextureName(param1); this.meshProps.push(local3); this.propObjectByMesh[local3] = param2; this.textureNameByMesh[local3] = local6; this.createOccluders(param2,components); if(param1.@name == "Elka") { this.christmasTree = local3; } } private function createOccluders(param1:PropMesh, param2:Vector.<Vector3D>) : void { var local3:Occluder = null; var local4:Matrix3D = null; var local5:Occluder = null; if(param1.occluders != null) { objectMatrix.recompose(param2); for each(local3 in param1.occluders) { local4 = local3.matrix; local4.append(objectMatrix); local5 = Occluder(local3.clone()); local5.matrix = local4; this.occluders.push(local5); } } } private function parseSprite(param1:XML, param2:PropSprite) : void { var local5:Vector3D = null; var local3:Sprite3D = Sprite3D(param2.object.clone()); if(param1.@name.indexOf("Shar") >= 0) { this.christmasTreeToys.push(local3); local5 = components[0]; readVector3D(param1.position,local5); local3.x = local5.x; local3.y = local5.y; local3.z = local5.z; local3.name = param1.@name; return; } local3.shadowMapAlphaThreshold = 0; local3.softAttenuation = 80; this.sprites.push(local3); var local4:Vector3D = components[0]; readVector3D(param1.position,local4); local3.x = local4.x; local3.y = local4.y; local3.z = local4.z; local3.width = param2.scale; this.texturedPropsRegistry.addSprite3D(param2,local3); } private function makeBSPs() : void { var local1:Object3D = null; var local2:Mesh = null; var local3:BSP = null; for each(local1 in this.meshProps) { local2 = local1 as Mesh; local3 = new BSP(); local3.name = Object3DNames.STATIC; local3.createTree(local2,true); local3.x = local2.x; local3.y = local2.y; local3.z = local2.z; local3.rotationZ = local2.rotationZ; this.texturedPropsRegistry.addBSP(this.propObjectByMesh[local2],this.textureNameByMesh[local2],local3); this.objects.push(local3); if(local2 == this.christmasTree) { this.christmasTree = local3; } } this.meshProps.length = 0; clearDictionary(this.propObjectByMesh); clearDictionary(this.textureNameByMesh); } public function clear() : void { this.propLibRegistry = null; this.texturedPropsRegistry.clear(); this.objects.length = 0; this.sprites.length = 0; this.occluders.length = 0; this.billboards.length = 0; this.christmasTree = null; this.christmasTreeToys.length = 0; } public function getObjects() : Vector.<Object3D> { return this.objects; } public function getSprites() : Vector.<Object3D> { return this.sprites; } public function getOccluders() : Vector.<Occluder> { return this.occluders; } public function getBillboards() : Vector.<Mesh> { return this.billboards; } public function getTexturedPropsCollections() : Vector.<TexturedPropsCollection> { return this.texturedPropsRegistry.getCollections(); } public function getMapBounds() : AABB { return this.mapBounds; } public function getChristmasTree() : Object3D { return this.christmasTree; } public function getChristmasTreeToys() : Vector.<Object3D> { return this.christmasTreeToys; } } }
package _codec.projects.tanks.client.panel.model.donationalert.user.donation { 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.donationalert.user.donation.DonationProfileCC; public class CodecDonationProfileCC implements ICodec { public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog)); private var codec_donator:ICodec; public function CodecDonationProfileCC() { super(); } public function init(param1:IProtocol) : void { this.codec_donator = param1.getCodec(new TypeCodecInfo(Boolean,false)); } public function decode(param1:ProtocolBuffer) : Object { var local2:DonationProfileCC = new DonationProfileCC(); local2.donator = this.codec_donator.decode(param1) as Boolean; return local2; } public function encode(param1:ProtocolBuffer, param2:Object) : void { if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:DonationProfileCC = DonationProfileCC(param2); this.codec_donator.encode(param1,local3.donator); } } }
package alternativa.tanks.engine3d { import alternativa.tanks.battle.events.BattleEventListener; public class MutableTextureRegistryCleaner implements BattleEventListener { private var registry:MutableTextureRegistry; public function MutableTextureRegistryCleaner(param1:MutableTextureRegistry) { super(); this.registry = param1; } public function handleBattleEvent(param1:Object) : void { this.registry.clear(); } } }
package projects.tanks.client.entrance.model.entrance.blockvalidator { 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 BlockValidatorModelServer { private var protocol:IProtocol; private var protocolBuffer:ProtocolBuffer; private var model:IModel; public function BlockValidatorModelServer(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 projects.tanks.client.partners.impl.steam { public interface ISteamLoginModelBase { } }
package alternativa.tanks.models.controlpoints.hud.marker { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.models.controlpoints.hud.marker.MarkerBitmaps_blueMarkerClass.png")] public class MarkerBitmaps_blueMarkerClass extends BitmapAsset { public function MarkerBitmaps_blueMarkerClass() { super(); } } }
package alternativa.tanks.battle.triggers { import alternativa.tanks.battle.DeferredAction; import alternativa.tanks.battle.Trigger; public class DeferredTriggerAddition implements DeferredAction { private var triggers:Triggers; private var trigger:Trigger; public function DeferredTriggerAddition(param1:Triggers, param2:Trigger) { super(); this.triggers = param1; this.trigger = param2; } public function execute() : void { this.triggers.add(this.trigger); } } }
package projects.tanks.client.garage.models.item.device { import platform.client.fp10.core.resource.types.ImageResource; public class ItemDevicesCC { private var _devicesAvailable:Boolean; private var _preview:ImageResource; private var _sale:Boolean; public function ItemDevicesCC(param1:Boolean = false, param2:ImageResource = null, param3:Boolean = false) { super(); this._devicesAvailable = param1; this._preview = param2; this._sale = param3; } public function get devicesAvailable() : Boolean { return this._devicesAvailable; } public function set devicesAvailable(param1:Boolean) : void { this._devicesAvailable = param1; } public function get preview() : ImageResource { return this._preview; } public function set preview(param1:ImageResource) : void { this._preview = param1; } public function get sale() : Boolean { return this._sale; } public function set sale(param1:Boolean) : void { this._sale = param1; } public function toString() : String { var local1:String = "ItemDevicesCC ["; local1 += "devicesAvailable = " + this.devicesAvailable + " "; local1 += "preview = " + this.preview + " "; local1 += "sale = " + this.sale + " "; return local1 + "]"; } } }
package controls.timer { import alternativa.osgi.service.logging.LogService; import flash.utils.clearInterval; import flash.utils.getTimer; import flash.utils.setInterval; import platform.client.fp10.core.type.AutoClosable; public class CountDownTimer implements AutoClosable { [Inject] public static var logService:LogService; private static var intervalId:int; private static var allTimers:Vector.<CountDownTimer> = new Vector.<CountDownTimer>(); private static var EMPTY_VECTOR:Vector.<Object> = new Vector.<Object>(0,true); private var endTime:Number; private var remainingTimeInSeconds:int; private var allListeners:Object = {}; public function CountDownTimer() { super(); } public static function resetAllTimers() : void { if(allTimers.length != 0) { clearInterval(intervalId); allTimers.length = 0; } } private static function onAllTimersTick() : void { var local3:CountDownTimer = null; var local1:int = getTimer(); var local2:int = allTimers.length - 1; while(local2 >= 0) { local3 = allTimers[local2]; local3.onTick(local1); local2--; } } public function addListener(param1:Class, param2:Object) : void { var local3:Vector.<Object> = this.allListeners[param1]; if(local3 == null) { this.allListeners[param1] = local3 = new Vector.<Object>(); } local3.push(param2); } public function removeListener(param1:Class, param2:Object) : void { var local3:Vector.<Object> = this.allListeners[param1]; if(local3 != null) { local3.splice(local3.indexOf(param2),1); } } public function start(param1:Number) : void { this.endTime = param1; this.addTimer(); this.remainingTimeInSeconds = Math.ceil((param1 - getTimer()) / 1000); } public function destroy() : void { this.removeTimer(); this.allListeners = {}; } public function stop() : void { this._stop(true); } private function _stop(param1:Boolean) : void { var local2:CountDownTimerOnCompleteBefore = null; var local3:CountDownTimerOnCompleteAfter = null; this.removeTimer(); this.remainingTimeInSeconds = 0; for each(local2 in this.getListeners(CountDownTimerOnCompleteBefore).concat()) { local2.onCompleteBefore(this,param1); } for each(local3 in this.getListeners(CountDownTimerOnCompleteAfter).concat()) { local3.onCompleteAfter(this,param1); } this.allListeners = {}; } public function getRemainingSeconds() : int { return this.remainingTimeInSeconds; } public function getEndTime() : uint { return this.endTime; } private function onTick(param1:int) : void { var local2:CountDownTimerOnTick = null; this.remainingTimeInSeconds = Math.ceil((this.endTime - param1) / 1000); if(this.remainingTimeInSeconds <= 0) { this._stop(false); } else { for each(local2 in this.getListeners(CountDownTimerOnTick)) { local2.onTick(this); } } } private function getListeners(param1:Class) : Vector.<Object> { var local2:Vector.<Object> = this.allListeners[param1]; if(local2 != null) { return local2; } return EMPTY_VECTOR; } private function addTimer() : void { if(allTimers.length == 0) { intervalId = setInterval(onAllTimersTick,1000); } allTimers.push(this); } private function removeTimer() : void { var local1:Number = Number(allTimers.indexOf(this)); if(local1 == -1) { return; } allTimers.splice(local1,1); if(allTimers.length == 0) { clearInterval(intervalId); } } public function close() : void { this.destroy(); } } }
package projects.tanks.client.battlefield.models.effects.activeafterdeath { public interface IActiveAfterDeathModelBase { } }
package alternativa.tanks.models.sfx.shoot.ricochet { import alternativa.init.Main; import alternativa.model.IModel; import alternativa.model.IObjectLoadListener; import alternativa.object.ClientObject; import alternativa.service.IModelService; import alternativa.tanks.engine3d.IMaterialSequenceRegistry; import alternativa.tanks.engine3d.ITextureMaterialRegistry; import alternativa.tanks.engine3d.MaterialType; import alternativa.tanks.models.sfx.colortransform.ColorTransformEntry; import alternativa.tanks.models.sfx.colortransform.IColorTransformModel; import alternativa.tanks.services.materialregistry.IMaterialRegistry; import alternativa.tanks.utils.GraphicsUtils; import com.alternativaplatform.projects.tanks.client.warfare.models.sfx.shoot.ricochet.IRicochetSFXModelBase; import com.alternativaplatform.projects.tanks.client.warfare.models.sfx.shoot.ricochet.RicochetSFXModelBase; import flash.display.BitmapData; import flash.geom.ColorTransform; import scpacker.resource.ResourceType; import scpacker.resource.ResourceUtil; public class RicochetSFXModel extends RicochetSFXModelBase implements IRicochetSFXModelBase, IObjectLoadListener, IRicochetSFXModel { private static var materialRegistry:IMaterialRegistry; public function RicochetSFXModel() { super(); _interfaces.push(IModel,IObjectLoadListener,IRicochetSFXModel); materialRegistry = IMaterialRegistry(Main.osgi.getService(IMaterialRegistry)); } public function initObject(clientObject:ClientObject, bumpFlashTextureId:String, explosionSoundId:String, explosionTextureId:String, ricochetSoundId:String, shotFlashTextureId:String, shotSoundId:String, shotTextureId:String, tailTrailTextureId:String) : void { var sfxData:RicochetSFXData = new RicochetSFXData(); var materialSequenceRegistry:IMaterialSequenceRegistry = materialRegistry.materialSequenceRegistry; var shotTexture:BitmapData = ResourceUtil.getResource(ResourceType.IMAGE,shotTextureId).bitmapData; sfxData.shotMaterials = materialSequenceRegistry.getSquareSequence(MaterialType.EFFECT,shotTexture,2).materials; var explosionTexture:BitmapData = ResourceUtil.getResource(ResourceType.IMAGE,explosionTextureId).bitmapData; sfxData.explosionMaterials = materialSequenceRegistry.getSquareSequence(MaterialType.EFFECT,explosionTexture,1.33).materials; var bumpFlashTexture:BitmapData = ResourceUtil.getResource(ResourceType.IMAGE,bumpFlashTextureId).bitmapData; sfxData.ricochetFlashMaterials = materialSequenceRegistry.getSquareSequence(MaterialType.EFFECT,bumpFlashTexture,0.4).materials; var textureMaterialRegistry:ITextureMaterialRegistry = materialRegistry.textureMaterialRegistry; var shotFlashTexture:BitmapData = ResourceUtil.getResource(ResourceType.IMAGE,shotFlashTextureId).bitmapData; sfxData.shotFlashMaterial = textureMaterialRegistry.getMaterial(MaterialType.EFFECT,shotFlashTexture,1); var tailTrailTexture:BitmapData = ResourceUtil.getResource(ResourceType.IMAGE,tailTrailTextureId).bitmapData; sfxData.tailTrailMaterial = textureMaterialRegistry.getMaterial(MaterialType.EFFECT,tailTrailTexture,2); sfxData.shotSound = ResourceUtil.getResource(ResourceType.SOUND,shotSoundId).sound; sfxData.ricochetSound = ResourceUtil.getResource(ResourceType.SOUND,ricochetSoundId).sound; sfxData.explosionSound = ResourceUtil.getResource(ResourceType.SOUND,explosionSoundId).sound; sfxData.dataExplosion = GraphicsUtils.getTextureAnimation(null,explosionTexture,200,200); sfxData.dataExplosion.fps = 30; sfxData.dataFlash = GraphicsUtils.getTextureAnimation(null,explosionTexture,200,200); sfxData.dataFlash.fps = 45; sfxData.dataShot = GraphicsUtils.getTextureAnimation(null,shotTexture,150,150); sfxData.dataShot.fps = 13; clientObject.putParams(RicochetSFXData,sfxData); } public function objectLoaded(object:ClientObject) : void { var sfxData:RicochetSFXData = null; var colorTransforms:Vector.<ColorTransformEntry> = null; var ctStruct:ColorTransformEntry = null; var modelService:IModelService = IModelService(Main.osgi.getService(IModelService)); var colorTransformModel:IColorTransformModel = IColorTransformModel(modelService.getModelForObject(object,IColorTransformModel)); if(colorTransformModel != null) { sfxData = this.getSfxData(object); colorTransforms = colorTransformModel.getModelData(object); if(colorTransforms.length > 0) { ctStruct = colorTransforms[0]; sfxData.colorTransform = new ColorTransform(ctStruct.redMultiplier,ctStruct.greenMultiplier,ctStruct.blueMultiplier,ctStruct.alphaMultiplier,ctStruct.redOffset,ctStruct.greenOffset,ctStruct.blueOffset,ctStruct.alphaOffset); } } } public function objectUnloaded(object:ClientObject) : void { } public function getSfxData(clientObject:ClientObject) : RicochetSFXData { return RicochetSFXData(clientObject.getParams(RicochetSFXData)); } } }
package alternativa.tanks.model.challenge { import alternativa.init.Main; import alternativa.osgi.service.locale.ILocaleService; import alternativa.tanks.locale.constants.TextConst; import alternativa.tanks.model.challenge.greenpanel.GreenPanel; import alternativa.tanks.model.challenge.server.ChallengeServerData; import controls.DefaultButton; import controls.Label; import controls.TankWindowInner; import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.Sprite; import flash.events.MouseEvent; import flash.events.TimerEvent; import flash.utils.Timer; import forms.TankWindowWithHeader; import forms.garage.GarageButton; import scpacker.networking.INetworker; import scpacker.networking.Network; public class ChallengeWindow extends Sprite { private static const noQuestBitmap:Class = ChallengeWindow_noQuestBitmap; private var bitmap:Bitmap; private var window:TankWindowWithHeader; private var innerWindow:TankWindowInner; private var panel:GreenPanel; private var specialPanel:SpecialChallengePanel; private var task:Label; private var taskValue:Label; private var progressLabel:Label; private var prize:Label; private var prizeValue:Label; private var completed:Label; public var changeBtn:GarageButton; public var closeBtn:DefaultButton; private var special:Boolean; private var offset:int; public function ChallengeWindow(specialChallenge:Boolean = false) { this.bitmap = new Bitmap(new noQuestBitmap().bitmapData); this.window = TankWindowWithHeader.createWindow(ILocaleService(Main.osgi.getService(ILocaleService)).getText(TextConst.MAIN_PANEL_BUTTON_CHALLENGE)); this.innerWindow = new TankWindowInner(0,0,TankWindowInner.GREEN); this.panel = new GreenPanel(250,90); this.task = new Label(); this.taskValue = new Label(); this.progressLabel = new Label(); this.prize = new Label(); this.prizeValue = new Label(); this.completed = new Label(); this.changeBtn = new GarageButton(); this.closeBtn = new DefaultButton(); super(); this.special = specialChallenge; if(this.special) { this.offset = 280; } this.createWindow(); this.addPanel(); } private function createWindow() : void { this.window.width = 300 + this.offset; this.window.height = 350; addChild(this.window); this.innerWindow.width = this.window.width - 30 - this.offset; this.innerWindow.height = this.window.height - 125; this.innerWindow.x = 15; this.innerWindow.y = 15; addChild(this.innerWindow); if(this.special) { this.specialPanel = new SpecialChallengePanel(this.innerWindow.width,this.innerWindow.height); this.specialPanel.x = this.innerWindow.x + this.innerWindow.width + 10; this.specialPanel.y = this.innerWindow.y; addChild(this.specialPanel); } this.changeBtn.x = this.window.width / 2 - this.changeBtn.width / 2 - this.offset / 2; this.changeBtn.y = this.window.height - this.changeBtn.height - 50; this.changeBtn.label = ILocaleService(Main.osgi.getService(ILocaleService)).getText(TextConst.CHALLENGES_WINDOW_BUTTON_CHANGE_TEXT); this.changeBtn.addEventListener(MouseEvent.CLICK,this.onChangeQuest); addChild(this.changeBtn); this.closeBtn.x = this.window.width - this.closeBtn.width - 10; this.closeBtn.y = this.window.height - this.closeBtn.height - 10; this.closeBtn.label = ILocaleService(Main.osgi.getService(ILocaleService)).getText(TextConst.FREE_BONUSES_WINDOW_BUTTON_CLOSE_TEXT); addChild(this.closeBtn); } private function addPanel() : void { this.bitmap.x = this.innerWindow.width / 2 - this.bitmap.width / 2; this.bitmap.y = 5; this.innerWindow.addChild(this.bitmap); this.panel.x = 10; this.panel.y = 125; this.innerWindow.addChild(this.panel); this.completed.color = 5898034; this.completed.text = ILocaleService(Main.osgi.getService(ILocaleService)).getText(TextConst.CHALLENGES_WINDOW_LABEL_COMPLETE_TEXT); this.completed.x = 10; this.completed.y = this.window.height - this.completed.height - 10; this.window.addChild(this.completed); this.task.color = 5898034; this.task.text = ILocaleService(Main.osgi.getService(ILocaleService)).getText(TextConst.CHALLENGES_WINDOW_LABEL_CHALLENGE_TEXT); this.task.x = 5; this.task.y = 5; this.panel.addChild(this.task); this.taskValue.color = 16777215; this.taskValue.x = 5; this.taskValue.y = 20; this.panel.addChild(this.taskValue); this.progressLabel.color = 16777215; this.progressLabel.x = this.panel.width - this.progressLabel.width - 5; this.progressLabel.y = 20; this.panel.addChild(this.progressLabel); this.prize.color = 5898034; this.prize.text = ILocaleService(Main.osgi.getService(ILocaleService)).getText(TextConst.CHALLENGES_WINDOW_LABEL_PRIZE_TEXT); this.prize.x = 5; this.prize.y = 55; this.panel.addChild(this.prize); this.prizeValue.color = 16777215; this.prizeValue.x = 5; this.prizeValue.y = 80; this.panel.addChild(this.prizeValue); } public function setChallegneData(quest:ChallengeServerData) : void { var prize:String = null; this.taskValue.text = quest.description; if(quest.changeCost > 0) { this.changeBtn.setInfo(quest.changeCost); } this.completed.text = this.completed.text.split(":")[0] + ": " + quest.completed; this.progressLabel.text = quest.progress + "/" + quest.target_progress; this.progressLabel.x = this.panel.width - this.progressLabel.width - 5; this.prize.y = 55; this.prizeValue.text = ""; this.prizeValue.y = 80; var countPrizes:int = quest.prizes.length; for each(prize in quest.prizes) { this.prizeValue.text += prize + "\n"; } this.prize.y -= countPrizes * (this.prize.height - 9); this.prizeValue.y = this.prize.y + 15; } public function show(quest:ChallengeServerData) : void { this.setChallegneData(quest); this.innerWindow.removeChild(this.bitmap); this.createNewIcon(quest.id.split("_" + quest.target_progress)[0]); if(quest.specialChallenge != null) { this.specialPanel.setChallegneData(quest.specialChallenge); } } private function onChangeQuest(event:MouseEvent) : void { var buttonTimer:Timer = null; Network(Main.osgi.getService(INetworker)).send("lobby;change_quest;"); this.changeBtn.enable = false; buttonTimer = new Timer(1000,1); buttonTimer.addEventListener(TimerEvent.TIMER,function(event:TimerEvent = null):void { changeBtn.enable = true; buttonTimer.stop(); buttonTimer = null; }); buttonTimer.start(); } private function createNewIcon(id:String) : void { this.bitmap = new Bitmap(this.getBitmapData(id)); this.bitmap.x = this.innerWindow.width / 2 - this.bitmap.width / 2; this.bitmap.y = 5; this.innerWindow.addChild(this.bitmap); } private function getBitmapData(id:String) : BitmapData { switch(id) { case "kill": return new ChallengesIcons.battleTypeBitmap().bitmapData; case "damage": return new ChallengesIcons.battleTypeBitmap().bitmapData; case "score": return new ChallengesIcons.winScoreBitmap().bitmapData; case "score_dm": return new ChallengesIcons.winScoreTypeBitmap().bitmapData; case "score_tdm": return new ChallengesIcons.winScoreTypeBitmap().bitmapData; case "score_ctf": return new ChallengesIcons.winScoreTypeBitmap().bitmapData; case "score_dom": return new ChallengesIcons.winScoreTypeBitmap().bitmapData; case "flag_capture": return new ChallengesIcons.battleTypeBitmap().bitmapData; case "flag_return": return new ChallengesIcons.battleTypeBitmap().bitmapData; case "capture_point": return new ChallengesIcons.battleTypeBitmap().bitmapData; case "neutralize_point": return new ChallengesIcons.battleTypeBitmap().bitmapData; case "win_score": return new ChallengesIcons.winScoreBitmap().bitmapData; case "win_cry": return new ChallengesIcons.winCryBitmap().bitmapData; case "first_place": return new ChallengesIcons.firstPlaceBitmap().bitmapData; case "first_place_dm": return new ChallengesIcons.firstPlaceBitmap().bitmapData; case "first_place_tdm": return new ChallengesIcons.firstPlaceBitmap().bitmapData; case "first_place_ctf": return new ChallengesIcons.firstPlaceBitmap().bitmapData; case "first_place_dom": return new ChallengesIcons.firstPlaceBitmap().bitmapData; default: return new noQuestBitmap().bitmapData; } } } }
package projects.tanks.client.commons.models.clienthalt { 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 ServerHaltModelServer { private var protocol:IProtocol; private var protocolBuffer:ProtocolBuffer; private var model:IModel; public function ServerHaltModelServer(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 _codec.projects.tanks.client.battlefield.models.user.configuration { 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 alternativa.types.Long; import projects.tanks.client.battlefield.models.user.configuration.TankConfigurationCC; public class CodecTankConfigurationCC implements ICodec { public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog)); private var codec_coloringId:ICodec; private var codec_droneId:ICodec; private var codec_hullId:ICodec; private var codec_weaponId:ICodec; public function CodecTankConfigurationCC() { super(); } public function init(param1:IProtocol) : void { this.codec_coloringId = param1.getCodec(new TypeCodecInfo(Long,false)); this.codec_droneId = param1.getCodec(new TypeCodecInfo(Long,false)); this.codec_hullId = param1.getCodec(new TypeCodecInfo(Long,false)); this.codec_weaponId = param1.getCodec(new TypeCodecInfo(Long,false)); } public function decode(param1:ProtocolBuffer) : Object { var local2:TankConfigurationCC = new TankConfigurationCC(); local2.coloringId = this.codec_coloringId.decode(param1) as Long; local2.droneId = this.codec_droneId.decode(param1) as Long; local2.hullId = this.codec_hullId.decode(param1) as Long; local2.weaponId = this.codec_weaponId.decode(param1) as Long; return local2; } public function encode(param1:ProtocolBuffer, param2:Object) : void { if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:TankConfigurationCC = TankConfigurationCC(param2); this.codec_coloringId.encode(param1,local3.coloringId); this.codec_droneId.encode(param1,local3.droneId); this.codec_hullId.encode(param1,local3.hullId); this.codec_weaponId.encode(param1,local3.weaponId); } } }
package alternativa.physics.contactislands { import alternativa.math.Vector3; import alternativa.physics.Body; import alternativa.physics.BodyContact; import alternativa.physics.PhysicsScene; import alternativa.physics.ShapeContact; public class ContactIsland { private static var poolSize:int; private static const pool:Vector.<ContactIsland> = new Vector.<ContactIsland>(); private static const _relativeVelocity:Vector3 = new Vector3(); private static const COLLISION_MODE:int = 0; private static const CONTACT_MODE:int = 1; public const bodyContacts:Vector.<BodyContact> = new Vector.<BodyContact>(); private var physicsScene:PhysicsScene; private const allShapeContacts:Vector.<ShapeContact> = new Vector.<ShapeContact>(); private const levelShapeContacts:Vector.<ShapeContact> = new Vector.<ShapeContact>(); private var prevLevelBodies:Vector.<Body> = new Vector.<Body>(); private var levelBodies:Vector.<Body> = new Vector.<Body>(); private const levelBodyContacts:Vector.<BodyContact> = new Vector.<BodyContact>(); private const contactLevels:ContactLevels = new ContactLevels(); public function ContactIsland() { super(); } public static function create() : ContactIsland { if(poolSize == 0) { return new ContactIsland(); } --poolSize; var local1:ContactIsland = pool[poolSize]; pool[poolSize] = null; return local1; } public function dispose() : void { this.physicsScene = null; this.bodyContacts.length = 0; this.allShapeContacts.length = 0; this.levelShapeContacts.length = 0; this.prevLevelBodies.length = 0; this.levelBodies.length = 0; this.levelBodyContacts.length = 0; this.contactLevels.clear(); var local1:* = poolSize++; pool[local1] = this; } public function init(param1:PhysicsScene) : void { var local5:BodyContact = null; var local6:Vector.<ShapeContact> = null; var local7:int = 0; var local8:int = 0; this.physicsScene = param1; var local2:int = int(this.bodyContacts.length); var local3:Vector.<ShapeContact> = this.allShapeContacts; var local4:int = 0; while(local4 < local2) { local5 = this.bodyContacts[local4]; local6 = local5.shapeContacts; local7 = int(local6.length); local8 = 0; while(local8 < local7) { local3[local3.length] = local6[local8]; local8++; } local4++; } } public function collisionPhase(param1:int) : void { this.resolveCollisions(param1); } public function contactPhase(param1:int) : void { this.resolveContacts(param1); } private function resolveCollisions(param1:int) : void { var local4:int = 0; var local2:int = int(this.allShapeContacts.length); var local3:int = 0; while(local3 < param1) { this.shuffleContacts(this.allShapeContacts); local4 = 0; while(local4 < local2) { this.resolveContact(this.allShapeContacts[local4],COLLISION_MODE); local4++; } local3++; } } private function resolveContacts(param1:int) : void { var local2:Vector.<Body> = null; var local3:int = 0; var local4:int = 0; var local5:ShapeContact = null; this.processContacts(param1); this.contactLevels.init(this.bodyContacts); this.contactLevels.getStaticLevel(this.levelBodyContacts,this.levelBodies); if(this.levelBodyContacts.length > 0) { this.getShapeContacts(this.levelBodyContacts,this.levelShapeContacts); this.resolveContactsForLevel(param1,this.levelShapeContacts); this.calculatePseudoVelocities(param1,this.levelShapeContacts); while(this.contactLevels.hasContacts()) { local2 = this.prevLevelBodies; this.prevLevelBodies = this.levelBodies; this.levelBodies = local2; this.levelBodyContacts.length = 0; this.levelBodies.length = 0; this.contactLevels.getNextLevel(this.prevLevelBodies,this.levelBodyContacts,this.levelBodies); this.setBodiesMobility(this.prevLevelBodies,false); this.levelShapeContacts.length = 0; this.getShapeContacts(this.levelBodyContacts,this.levelShapeContacts); local3 = int(this.levelShapeContacts.length); local4 = 0; while(local4 < local3) { local5 = this.levelShapeContacts[local4]; local5.calcualteDynamicFrameData(this.physicsScene.allowedPenetration,this.physicsScene.penetrationErrorCorrection,this.physicsScene.maxCorrectablePenetration,this.physicsScene.dt); local4++; } this.resolveContactsForLevel(param1,this.levelShapeContacts); this.calculatePseudoVelocities(param1,this.levelShapeContacts); this.setBodiesMobility(this.prevLevelBodies,true); } } else { this.getShapeContacts(this.bodyContacts,this.levelShapeContacts); this.resolveContactsForLevel(param1,this.levelShapeContacts); this.calculatePseudoVelocities(param1,this.levelShapeContacts); } } private function processContacts(param1:int) : void { var local4:int = 0; var local2:int = int(this.allShapeContacts.length); var local3:int = 0; while(local3 < param1) { this.shuffleContacts(this.allShapeContacts); local4 = 0; while(local4 < local2) { this.resolveContact(this.allShapeContacts[local4],CONTACT_MODE); local4++; } local3++; } } private function getShapeContacts(param1:Vector.<BodyContact>, param2:Vector.<ShapeContact>) : void { var local5:BodyContact = null; var local6:Vector.<ShapeContact> = null; var local7:int = 0; var local8:int = 0; var local3:int = int(param1.length); var local4:int = 0; while(local4 < local3) { local5 = param1[local4]; local6 = local5.shapeContacts; local7 = int(local6.length); local8 = 0; while(local8 < local7) { param2[param2.length] = local6[local8]; local8++; } local4++; } } private function shuffleContacts(param1:Vector.<ShapeContact>) : void { var local4:int = 0; var local5:ShapeContact = null; var local2:int = int(param1.length); var local3:int = 1; while(local3 < local2) { local4 = local3 * Math.random(); local5 = param1[local4]; param1[local4] = param1[local3]; param1[local3] = local5; local3++; } } private function resolveContactsForLevel(param1:int, param2:Vector.<ShapeContact>) : void { var local4:int = 0; var local5:int = 0; var local3:int = 0; while(local3 < param1) { this.shuffleContacts(param2); local4 = int(param2.length); local5 = 0; while(local5 < local4) { this.resolveContact(param2[local5],CONTACT_MODE); local5++; } local3++; } } private function calculatePseudoVelocities(param1:int, param2:Vector.<ShapeContact>) : void { var local4:int = 0; var local5:int = 0; var local3:int = 0; while(local3 < param1) { this.shuffleContacts(param2); local4 = int(param2.length); local5 = 0; while(local5 < local4) { this.resolveContactPseudoVelocity(param2[local5]); local5++; } local3++; } } private function setBodiesMobility(param1:Vector.<Body>, param2:Boolean) : void { var local5:Body = null; var local3:int = int(param1.length); var local4:int = 0; while(local4 < local3) { local5 = param1[local4]; local5.movable = param2; local4++; } } private function resolveContact(param1:ShapeContact, param2:int) : void { var local8:Number = NaN; var local20:Number = NaN; var local3:Vector3 = param1.normal; var local4:Body = param1.shape1.body; var local5:Body = param1.shape2.body; var local6:Vector3 = _relativeVelocity; this.calculateRelativeVelocity(param1,local6); var local7:Number = local6.x * local3.x + local6.y * local3.y + local6.z * local3.z; if(param2 == CONTACT_MODE) { local8 = 0; if(local7 < 0) { param1.satisfied = false; } else if(param1.satisfied) { return; } } else { param1.satisfied = true; local8 = param1.collisionSpeed; } var local9:Number = local6.dot(param1.tangent1); var local10:Number = local6.dot(param1.tangent2); var local11:Number = param1.tangentImpulse1 - local9 / param1.tangentSpeedDelta1; var local12:Number = param1.tangentImpulse2 - local10 / param1.tangentSpeedDelta2; var local13:Number = local11 * local11 + local12 * local12; var local14:Number = param1.friction * param1.normalImpulse; if(local13 > local14 * local14) { local20 = Math.sqrt(local13); local11 *= local14 / local20; local12 *= local14 / local20; } var local15:Number = local11 - param1.tangentImpulse1; var local16:Number = local12 - param1.tangentImpulse2; param1.tangentImpulse1 = local11; param1.tangentImpulse2 = local12; if(local4.movable) { local4.applyWorldImpulseAtLocalPoint(param1.r1,param1.tangent1,local15); local4.applyWorldImpulseAtLocalPoint(param1.r1,param1.tangent2,local16); } if(local5.movable) { local5.applyWorldImpulseAtLocalPoint(param1.r2,param1.tangent1,-local15); local5.applyWorldImpulseAtLocalPoint(param1.r2,param1.tangent2,-local16); } this.calculateRelativeVelocity(param1,local6); local7 = local6.x * local3.x + local6.y * local3.y + local6.z * local3.z; var local17:Number = local8 - local7; var local18:Number = param1.normalImpulse + local17 / param1.normalSpeedDelta; if(local18 < 0) { local18 = 0; } var local19:Number = local18 - param1.normalImpulse; param1.normalImpulse = local18; if(local4.movable) { local4.applyWorldImpulseAtLocalPoint(param1.r1,param1.normal,local19); } if(local5.movable) { local5.applyWorldImpulseAtLocalPoint(param1.r2,param1.normal,-local19); } } private function calculateRelativeVelocity(param1:ShapeContact, param2:Vector3) : void { var local4:Vector3 = null; var local3:Vector3 = param1.shape1.body.state.angularVelocity; local4 = param1.r1; var local5:Number = local3.y * local4.z - local3.z * local4.y; var local6:Number = local3.z * local4.x - local3.x * local4.z; var local7:Number = local3.x * local4.y - local3.y * local4.x; local4 = param1.shape1.body.state.velocity; param2.x = local4.x + local5; param2.y = local4.y + local6; param2.z = local4.z + local7; local3 = param1.shape2.body.state.angularVelocity; local4 = param1.r2; local5 = local3.y * local4.z - local3.z * local4.y; local6 = local3.z * local4.x - local3.x * local4.z; local7 = local3.x * local4.y - local3.y * local4.x; local4 = param1.shape2.body.state.velocity; param2.x -= local4.x + local5; param2.y -= local4.y + local6; param2.z -= local4.z + local7; } private function resolveContactPseudoVelocity(param1:ShapeContact) : void { var local2:Vector3 = _relativeVelocity; this.calcPseudoSeparationVelocity(param1,local2); var local3:Number = local2.x * param1.normal.x + local2.y * param1.normal.y + local2.z * param1.normal.z; var local4:Number = param1.contactSeparationSpeed - local3; var local5:Number = local4 / param1.normalSpeedDelta; if(param1.shape1.body.movable) { param1.shape1.body.applyWorldPseudoImpulseAtLocalPoint(param1.r1,param1.normal,local5); } if(param1.shape2.body.movable) { param1.shape2.body.applyWorldPseudoImpulseAtLocalPoint(param1.r2,param1.normal,-local5); } } private function calcPseudoSeparationVelocity(param1:ShapeContact, param2:Vector3) : void { var local4:Vector3 = null; var local3:Vector3 = param1.shape1.body.pseudoAngularVelocity; local4 = param1.r1; var local5:Number = local3.y * local4.z - local3.z * local4.y; var local6:Number = local3.z * local4.x - local3.x * local4.z; var local7:Number = local3.x * local4.y - local3.y * local4.x; local4 = param1.shape1.body.pseudoVelocity; param2.x = local4.x + local5; param2.y = local4.y + local6; param2.z = local4.z + local7; local3 = param1.shape2.body.pseudoAngularVelocity; local4 = param1.r2; local5 = local3.y * local4.z - local3.z * local4.y; local6 = local3.z * local4.x - local3.x * local4.z; local7 = local3.x * local4.y - local3.y * local4.x; local4 = param1.shape2.body.pseudoVelocity; param2.x -= local4.x + local5; param2.y -= local4.y + local6; param2.z -= local4.z + local7; } } }
package alternativa.tanks.model.battleselect { import alternativa.tanks.controllers.battlelist.BattleByURLNotFoundEvent; import alternativa.tanks.model.info.ShowInfo; import alternativa.tanks.service.battle.BattleFriendNotifier; import alternativa.tanks.service.battleinfo.IBattleInfoFormService; import alternativa.tanks.service.battlelist.BattleListFormServiceEvent; import alternativa.tanks.service.battlelist.IBattleListFormService; import alternativa.tanks.tracker.ITrackerService; import flash.utils.clearTimeout; import flash.utils.setTimeout; import platform.client.fp10.core.model.ObjectLoadPostListener; import platform.client.fp10.core.model.ObjectUnloadListener; import platform.client.fp10.core.type.IGameObject; import projects.tanks.client.battleselect.model.battleselect.BattleSelectModelBase; import projects.tanks.client.battleselect.model.battleselect.IBattleSelectModelBase; [ModelInfo] public class BattleSelectModel extends BattleSelectModelBase implements IBattleSelectModelBase, ObjectLoadPostListener, ObjectUnloadListener { [Inject] public static var battleListFormService:IBattleListFormService; [Inject] public static var battleInfoFormService:IBattleInfoFormService; [Inject] public static var trackerService:ITrackerService; private var battleFriendNotifier:BattleFriendNotifier; private var selectTimeoutId:int = -1; public function BattleSelectModel() { super(); } public function select(param1:IGameObject) : void { battleListFormService.selectBattleItemFromServer(param1); ShowInfo(param1.adapt(ShowInfo)).showInfo(); this.clearSelectTimeout(); } public function objectLoadedPost() : void { this.battleFriendNotifier = new BattleFriendNotifier(); battleListFormService.createAndShow(); battleListFormService.addEventListener(BattleListFormServiceEvent.BATTLE_SELECTED,getFunctionWrapper(this.onBattleSelected)); battleListFormService.addEventListener(BattleByURLNotFoundEvent.BATTLE_BY_URL_NOT_FOUND,getFunctionWrapper(this.onBattleByURLNotFound)); trackerService.trackEvent("battleList","init",""); } public function objectUnloaded() : void { this.battleFriendNotifier.destroy(); this.battleFriendNotifier = null; battleInfoFormService.destroy(); battleListFormService.removeEventListener(BattleListFormServiceEvent.BATTLE_SELECTED,getFunctionWrapper(this.onBattleSelected)); battleListFormService.removeEventListener(BattleByURLNotFoundEvent.BATTLE_BY_URL_NOT_FOUND,getFunctionWrapper(this.onBattleByURLNotFound)); battleListFormService.hideAndDestroy(); this.clearSelectTimeout(); } private function onBattleSelected(param1:BattleListFormServiceEvent) : void { var event:BattleListFormServiceEvent = param1; this.clearSelectTimeout(); this.selectTimeoutId = setTimeout(getFunctionWrapper(function():void { server.onSelect(event.selectedItem); }),1000); ShowInfo(event.selectedItem.adapt(ShowInfo)).showInfo(); } private function onBattleByURLNotFound(param1:BattleByURLNotFoundEvent) : void { server.search(param1.battleId); } public function battleItemsPacketJoinSuccess() : void { battleListFormService.battleItemsPacketJoinSuccess(); } private function clearSelectTimeout() : void { if(this.selectTimeoutId != -1) { clearTimeout(this.selectTimeoutId); } this.selectTimeoutId = -1; } } }
package alternativa.engine3d.animation.keys { import alternativa.engine3d.alternativa3d; use namespace alternativa3d; public class NumberKey extends Keyframe { alternativa3d var _value:Number = 0; alternativa3d var next:NumberKey; public function NumberKey() { super(); } public function interpolate(param1:NumberKey, param2:NumberKey, param3:Number) : void { this.alternativa3d::_value = (1 - param3) * param1.alternativa3d::_value + param3 * param2.alternativa3d::_value; } override public function get value() : Object { return this.alternativa3d::_value; } override public function set value(param1:Object) : void { this.alternativa3d::_value = Number(param1); } override alternativa3d function get nextKeyFrame() : Keyframe { return this.alternativa3d::next; } override alternativa3d function set nextKeyFrame(param1:Keyframe) : void { this.alternativa3d::next = NumberKey(param1); } } }
package alternativa.tanks.models.battlefield.effects.graffiti { import mx.core.BitmapAsset; [ExcludeClass] public class TexturesManager_graffiti_money extends BitmapAsset { public function TexturesManager_graffiti_money() { super(); } } }
package forms.ranks { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/forms.ranks.DefaultRanksBitmaps_bitmapBigRank03.png")] public class DefaultRanksBitmaps_bitmapBigRank03 extends BitmapAsset { public function DefaultRanksBitmaps_bitmapBigRank03() { super(); } } }
package alternativa.tanks.models.effects.common { import alternativa.tanks.bonuses.Bonus; import alternativa.types.Long; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; public class IBonusCommonModelAdapt implements IBonusCommonModel { private var object:IGameObject; private var impl:IBonusCommonModel; public function IBonusCommonModelAdapt(param1:IGameObject, param2:IBonusCommonModel) { super(); this.object = param1; this.impl = param2; } public function getBonus(param1:Long) : Bonus { var result:Bonus = null; var bonusInstanceId:Long = param1; try { Model.object = this.object; result = this.impl.getBonus(bonusInstanceId); } finally { Model.popObject(); } return result; } } }
package _codec.projects.tanks.client.garage.models.item.properties { 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.EnumCodecInfo; import alternativa.protocol.info.TypeCodecInfo; import projects.tanks.client.commons.types.ItemGarageProperty; import projects.tanks.client.garage.models.item.properties.ItemGaragePropertyData; public class CodecItemGaragePropertyData implements ICodec { public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog)); private var codec_property:ICodec; private var codec_value:ICodec; public function CodecItemGaragePropertyData() { super(); } public function init(param1:IProtocol) : void { this.codec_property = param1.getCodec(new EnumCodecInfo(ItemGarageProperty,false)); this.codec_value = param1.getCodec(new TypeCodecInfo(String,false)); } public function decode(param1:ProtocolBuffer) : Object { var local2:ItemGaragePropertyData = new ItemGaragePropertyData(); local2.property = this.codec_property.decode(param1) as ItemGarageProperty; local2.value = this.codec_value.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:ItemGaragePropertyData = ItemGaragePropertyData(param2); this.codec_property.encode(param1,local3.property); this.codec_value.encode(param1,local3.value); } } }
package projects.tanks.client.panel.model.payment.modes.qiwi { public class QiwiPaymentCC { private var _countryPhoneCodes:Vector.<CountryPhoneInfo>; public function QiwiPaymentCC(param1:Vector.<CountryPhoneInfo> = null) { super(); this._countryPhoneCodes = param1; } public function get countryPhoneCodes() : Vector.<CountryPhoneInfo> { return this._countryPhoneCodes; } public function set countryPhoneCodes(param1:Vector.<CountryPhoneInfo>) : void { this._countryPhoneCodes = param1; } public function toString() : String { var local1:String = "QiwiPaymentCC ["; local1 += "countryPhoneCodes = " + this.countryPhoneCodes + " "; return local1 + "]"; } } }
package _codec.platform.client.core.general.socialnetwork.types { import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import platform.client.core.general.socialnetwork.types.Gender; public class CodecGender implements ICodec { public function CodecGender() { super(); } public function init(param1:IProtocol) : void { } public function decode(param1:ProtocolBuffer) : Object { var local2:Gender = null; var local3:int = int(param1.reader.readInt()); switch(local3) { case 0: local2 = Gender.MALE; break; case 1: local2 = Gender.FEMALE; break; case 2: local2 = Gender.NONE; } 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.models.battle.battlefield.mine { public class MineModelData { public var armedFlashDuration:int; public var armedFlashFadeDuration:int; public var flashChannelOffset:int; public var farRadius:Number = 1500; public var nearRadius:Number = 500; public function MineModelData() { super(); } } }
package alternativa.tanks.servermodels.logging { import alternativa.startup.StartupSettings; import alternativa.tanks.controller.events.logging.RegistrationUXFormEvent; import alternativa.tanks.controller.events.logging.RegistrationUXNavigationFinishEvent; import alternativa.tanks.controller.events.logging.RegistrationUXNavigationStartEvent; import alternativa.tanks.service.IRegistrationUXService; import flash.external.ExternalInterface; import flash.utils.getTimer; import platform.client.fp10.core.model.ObjectLoadListener; import platform.client.fp10.core.model.ObjectUnloadListener; import projects.tanks.client.entrance.model.entrance.logging.IRegistrationUXLoggerModelBase; import projects.tanks.client.entrance.model.entrance.logging.RegistrationUXLoggerModelBase; [ModelInfo] public class RegistrationUXLoggerModel extends RegistrationUXLoggerModelBase implements IRegistrationUXLoggerModelBase, ObjectLoadListener, ObjectUnloadListener { [Inject] public static var registrationUXService:IRegistrationUXService; private static const COOKIE_EXISTS_FUNC:String = "Cookie.exists"; private static const TUTORIAL_TOKEN:String = "TUTORIAL_TOKEN"; public function RegistrationUXLoggerModel() { super(); } public function objectLoaded() : void { registrationUXService.addEventListener(RegistrationUXFormEvent.FORM_ACTION,getFunctionWrapper(this.onFormEvent)); registrationUXService.addEventListener(RegistrationUXNavigationStartEvent.NAVIGATION_START,getFunctionWrapper(this.onNavigationStart)); registrationUXService.addEventListener(RegistrationUXNavigationFinishEvent.NAVIGATION_FINISH,getFunctionWrapper(this.onNavigationFinish)); var local1:Number = new Date().valueOf() - getTimer(); server.initLogger(local1.toString(),this.isTutorialUser(),StartupSettings.isUserFromTutorial()); } public function objectUnloaded() : void { registrationUXService.removeEventListener(RegistrationUXFormEvent.FORM_ACTION,getFunctionWrapper(this.onFormEvent)); registrationUXService.removeEventListener(RegistrationUXNavigationStartEvent.NAVIGATION_START,getFunctionWrapper(this.onNavigationStart)); registrationUXService.removeEventListener(RegistrationUXNavigationFinishEvent.NAVIGATION_FINISH,getFunctionWrapper(this.onNavigationFinish)); } private function onFormEvent(param1:RegistrationUXFormEvent) : void { server.logFormAction(param1.action,param1.count); } private function onNavigationStart(param1:RegistrationUXNavigationStartEvent) : void { server.logNavigationStart(param1.screen); } private function onNavigationFinish(param1:RegistrationUXNavigationFinishEvent) : void { server.logNavigationFinish(); } private function isTutorialUser() : Boolean { return ExternalInterface.available && ExternalInterface.call(COOKIE_EXISTS_FUNC,TUTORIAL_TOKEN) > 0; } } }
package controls.dropdownlist { import controls.base.LabelBase; import flash.display.Sprite; import flash.text.TextFieldAutoSize; import forms.ranks.SmallRankIcon; public class ComboR extends ComboBoxRenderer { public function ComboR() { super(); } override protected function myIcon(param1:Object) : Sprite { var local3:LabelBase = null; var local4:SmallRankIcon = null; var local2:Sprite = new Sprite(); local3 = new LabelBase(); local3.autoSize = TextFieldAutoSize.NONE; local3.color = 16777215; local3.alpha = param1.rang > 0 ? 0.5 : 1; local3.text = param1.gameName; local3.height = 20; local3.width = _width - 20; local3.y = 0; if(param1.rang > 0) { local4 = new SmallRankIcon(param1.rang); local4.x = -2; local4.y = 2; local2.addChild(local4); local3.x = 12; } else { local3.x = -3; } local2.addChild(local3); return local2; } } }
package controls { import flash.display.Bitmap; import flash.display.BitmapData; public class FBButton extends DefaultIconButton { private static const releaseBitmapFB:Class = FBButton_releaseBitmapFB; private static const releaseFB:BitmapData = (new releaseBitmapFB() as Bitmap).bitmapData; private static const pressedBitmapFB:Class = FBButton_pressedBitmapFB; private static const pressedFB:BitmapData = (new pressedBitmapFB() as Bitmap).bitmapData; private static const hoveredBitmapFB:Class = FBButton_hoveredBitmapFB; private static const hoveredFB:BitmapData = (new hoveredBitmapFB() as Bitmap).bitmapData; public function FBButton() { super(releaseFB,hoveredFB,pressedFB); } } }
package alternativa.tanks.gui.payment.controls { import alternativa.osgi.service.locale.ILocaleService; import alternativa.tanks.gui.icons.CrystalIcon; import controls.base.LabelBase; import flash.display.Bitmap; import flash.display.Sprite; import flash.filters.DropShadowFilter; import flash.text.TextFieldAutoSize; import projects.tanks.clients.fp10.libraries.TanksLocale; public class BonusLabel extends Sprite { [Inject] public static var localeService:ILocaleService; private var crystalsLabel:LabelBase; private var textLabel:LabelBase; private var crystalBitmap:Bitmap; public function BonusLabel() { super(); this.crystalBitmap = CrystalIcon.createSmallInstance(); this.crystalBitmap.y = 4; addChild(this.crystalBitmap); this.crystalsLabel = new LabelBase(); this.crystalsLabel.filters = [new DropShadowFilter(1,45,0,0.7,1,1,1)]; this.crystalsLabel.size = 13; this.crystalsLabel.bold = true; this.crystalsLabel.autoSize = TextFieldAutoSize.LEFT; addChild(this.crystalsLabel); this.textLabel = new LabelBase(); this.textLabel.filters = [new DropShadowFilter(1,45,0,0.7,1,1,1)]; this.textLabel.size = 13; this.textLabel.bold = true; this.textLabel.autoSize = TextFieldAutoSize.LEFT; this.textLabel.text = localeService.getText(TanksLocale.TEXT_PAYMENT_PRESENT_LABEL_TEXT); addChild(this.textLabel); } public function setCrystals(param1:int) : void { this.crystalsLabel.text = "+" + param1.toString(); this.draw(); } private function draw() : void { var local1:int = this.crystalsLabel.width + this.crystalBitmap.width; if(this.textLabel.width > local1) { local1 = this.textLabel.width; } this.crystalsLabel.x = (local1 - this.crystalsLabel.width - this.crystalBitmap.width) * 0.5; this.crystalBitmap.x = this.crystalsLabel.x + this.crystalsLabel.width; this.textLabel.y = this.crystalsLabel.height - 5; this.textLabel.x = (local1 - this.textLabel.width) * 0.5; } } }
package projects.tanks.client.panel.model.abonements { public class UserAbonementsCC { private var _abonementDataList:Vector.<ShopAbonementData>; public function UserAbonementsCC(param1:Vector.<ShopAbonementData> = null) { super(); this._abonementDataList = param1; } public function get abonementDataList() : Vector.<ShopAbonementData> { return this._abonementDataList; } public function set abonementDataList(param1:Vector.<ShopAbonementData>) : void { this._abonementDataList = param1; } public function toString() : String { var local1:String = "UserAbonementsCC ["; local1 += "abonementDataList = " + this.abonementDataList + " "; return local1 + "]"; } } }
package alternativa.model.description { import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; public class IDescriptionEvents implements IDescription { private var object:IGameObject; private var impl:Vector.<Object>; public function IDescriptionEvents(param1:IGameObject, param2:Vector.<Object>) { super(); this.object = param1; this.impl = param2; } public function getName() : String { var result:String = null; var i:int = 0; var m:IDescription = null; try { Model.object = this.object; i = 0; while(i < this.impl.length) { m = IDescription(this.impl[i]); result = m.getName(); i++; } } finally { Model.popObject(); } return result; } public function getDescription() : String { var result:String = null; var i:int = 0; var m:IDescription = null; try { Model.object = this.object; i = 0; while(i < this.impl.length) { m = IDescription(this.impl[i]); result = m.getDescription(); i++; } } finally { Model.popObject(); } return result; } } }
package projects.tanks.client.battlefield.models.user.damageindicator { import platform.client.fp10.core.type.IGameObject; public class TargetTankDamage { private var _damageAmount:Number; private var _damageIndicatorType:DamageIndicatorType; private var _target:IGameObject; public function TargetTankDamage(param1:Number = 0, param2:DamageIndicatorType = null, param3:IGameObject = null) { super(); this._damageAmount = param1; this._damageIndicatorType = param2; this._target = param3; } public function get damageAmount() : Number { return this._damageAmount; } public function set damageAmount(param1:Number) : void { this._damageAmount = param1; } public function get damageIndicatorType() : DamageIndicatorType { return this._damageIndicatorType; } public function set damageIndicatorType(param1:DamageIndicatorType) : void { this._damageIndicatorType = param1; } public function get target() : IGameObject { return this._target; } public function set target(param1:IGameObject) : void { this._target = param1; } public function toString() : String { var local1:String = "TargetTankDamage ["; local1 += "damageAmount = " + this.damageAmount + " "; local1 += "damageIndicatorType = " + this.damageIndicatorType + " "; local1 += "target = " + this.target + " "; return local1 + "]"; } } }
package _codec.projects.tanks.client.battlefield.models.user.resistance { 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.EnumCodecInfo; import alternativa.protocol.info.TypeCodecInfo; import alternativa.types.Byte; import projects.tanks.client.battlefield.models.user.resistance.TankResistance; import projects.tanks.client.garage.models.item.properties.ItemProperty; public class CodecTankResistance implements ICodec { public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog)); private var codec_resistanceInPercent:ICodec; private var codec_resistanceProperty:ICodec; public function CodecTankResistance() { super(); } public function init(param1:IProtocol) : void { this.codec_resistanceInPercent = param1.getCodec(new TypeCodecInfo(Byte,false)); this.codec_resistanceProperty = param1.getCodec(new EnumCodecInfo(ItemProperty,false)); } public function decode(param1:ProtocolBuffer) : Object { var local2:TankResistance = new TankResistance(); local2.resistanceInPercent = this.codec_resistanceInPercent.decode(param1) as int; local2.resistanceProperty = this.codec_resistanceProperty.decode(param1) as ItemProperty; return local2; } public function encode(param1:ProtocolBuffer, param2:Object) : void { if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:TankResistance = TankResistance(param2); this.codec_resistanceInPercent.encode(param1,local3.resistanceInPercent); this.codec_resistanceProperty.encode(param1,local3.resistanceProperty); } } }
package _codec.projects.tanks.client.battlefield.models.battle.jgr { 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.jgr.JuggernautCC; public class VectorCodecJuggernautCCLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecJuggernautCCLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new TypeCodecInfo(JuggernautCC,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.<JuggernautCC> = new Vector.<JuggernautCC>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = JuggernautCC(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:JuggernautCC = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<JuggernautCC> = Vector.<JuggernautCC>(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 _codec.projects.tanks.client.battlefield.models.tankparts.sfx.shoot.shaft { 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.sfx.shoot.shaft.ShaftShootSFXCC; public class VectorCodecShaftShootSFXCCLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecShaftShootSFXCCLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new TypeCodecInfo(ShaftShootSFXCC,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.<ShaftShootSFXCC> = new Vector.<ShaftShootSFXCC>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = ShaftShootSFXCC(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:ShaftShootSFXCC = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<ShaftShootSFXCC> = Vector.<ShaftShootSFXCC>(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.models.weapon { import alternativa.physics.Body; import alternativa.tanks.models.battle.commonflag.CommonFlag; import flash.utils.Dictionary; public class FlagTargetEvaluator { private var carriers:Dictionary = new Dictionary(); public function FlagTargetEvaluator() { super(); } public function setFlagCarrier(param1:CommonFlag, param2:Body) : void { if(param2 != null) { this.carriers[param1] = param2; } else { delete this.carriers[param1]; } } public function isCarrier(param1:Body) : Boolean { var local2:Body = null; for each(local2 in this.carriers) { if(local2 == param1) { return true; } } return false; } } }
package alternativa.tanks.models.weapon.rocketlauncher.radio { import platform.client.fp10.core.type.IGameObject; public class RocketExplosionAdapt implements RocketExplosion { private var object:IGameObject; private var impl:RocketExplosion; public function RocketExplosionAdapt(param1:IGameObject, param2:RocketExplosion) { super(); this.object = param1; this.impl = param2; } } }
package { import assets.scroller.ScrollThumbSkin; [Embed(source="/_assets/assets.swf", symbol="symbol490")] public dynamic class ScrollThumb_downSkin extends ScrollThumbSkin { public function ScrollThumb_downSkin() { super(); } } }
package alternativa.tanks.view.battlecreate { import alternativa.osgi.service.display.IDisplay; import alternativa.tanks.controllers.battlecreate.CreateBattleFormController; import alternativa.tanks.controllers.battlecreate.CreateBattleMapParams; import alternativa.tanks.tracker.ITrackerService; import alternativa.tanks.view.battlecreate.slider.SelectRankSlider; import alternativa.tanks.view.battlecreate.slider.SelectRankSliderEvent; import alternativa.tanks.view.battleinfo.BattleInfoParamsView; import alternativa.tanks.view.icons.BattleParamsCheckButtonIcons; import assets.icons.BattleInfoIcons; import base.DiscreteSprite; import controls.NumStepper; import controls.ValidationIcon; import controls.base.RedButtonBase; import controls.base.TankInputBase; import controls.checkbox.CheckBoxBase; import controls.checkbox.CheckBoxEvent; import controls.dropdownlist.ComboBoxRenderer; import controls.dropdownlist.DropDownList; import flash.display.DisplayObject; import flash.events.Event; import flash.events.FocusEvent; import flash.events.MouseEvent; import flash.utils.Dictionary; import flash.utils.clearTimeout; import flash.utils.setTimeout; import forms.TankWindowWithHeader; import forms.events.LoginFormEvent; import projects.tanks.client.battleservice.BattleMode; import projects.tanks.client.battleservice.model.map.params.MapTheme; import projects.tanks.clients.flash.commons.services.timeunit.ITimeUnitService; import projects.tanks.clients.fp10.libraries.TanksLocale; import projects.tanks.clients.fp10.libraries.tanksservices.service.clan.ClanUserInfoService; public class CreateBattleFormView extends DiscreteSprite { [Inject] public static var display:IDisplay; [Inject] public static var trackerService:ITrackerService; [Inject] public static var timeUnitService:ITimeUnitService; [Inject] public static var clanUserInfoService:ClanUserInfoService; private static const GA_CATEGORY:String = "lobby"; private static const GA_ACTION:String = "createBattle"; private static const MIN_FLASH_WIDTH:int = 970; private static const MIN_FLASH_HEIGHT:int = 530; private static const HEADER_HEIGHT:int = 60; private static const FIRST_COLUMN_X:int = 11; private static const RIGHT_MARGIN:Number = 11; private static const MAX_CHARS_BATTLE_NAME:int = 25; private var _isShowThemeComboBox:Boolean; private var controller:CreateBattleFormController; private var _timeOutResize:uint; private var _window:TankWindowWithHeader; private var _chooseMapComboBox:DropDownList; private var _chooseThemeMapComboBox:DropDownList; private var _chooseFormatComboBox:DropDownList; public var battleInfo:BattleInfoParamsView; private var _chooseRankSlider:SelectRankSlider; private var _chooseTypeBattle:ChooseTypeBattleView; private var _maxNumberPlayersStepper:NumStepper; private var _timeLimitStepper:NumStepper; private var _scoreLimitStepper:NumStepper; private var _autoBalanceCheckBox:CheckBoxBase; private var _friendlyFireCheckBox:CheckBoxBase; private var _dronesCheckBox:CheckBoxBase; private var _suppliesCheckBox:CheckBoxBase; private var _dependentCooldownCheckBox:CheckBoxBase; private var _bonusesCheckBox:CheckBoxBase; private var _goldBoxesCheckBox:CheckBoxBase; private var _upgradesCheckBox:CheckBoxBase; private var _privateBattleCheckBox:CheckBoxBase; private var _reArmorCheckBox:CheckBoxBase; private var _startButton:RedButtonBase; private var _devicesCheckBox:CheckBoxBase; private var _clanCheckBox:CheckBoxBase; private var ultimatesCheckBox:CheckBoxBase; private var _battleNameTextInput:TankInputBase; private var _battleNameCheckIcon:ValidationIcon; private var _trackedEvents:Dictionary = new Dictionary(); private var scoreWidth:int; private var playersWidth:int; public function CreateBattleFormView(param1:CreateBattleFormController) { super(); this.controller = param1; this._window = TankWindowWithHeader.createWindow(TanksLocale.TEXT_HEADER_CREATE_BATTLE); addChild(this._window); this.battleInfo = new BattleInfoParamsView(); addChild(this.battleInfo); this._chooseRankSlider = new SelectRankSlider(); addChild(this._chooseRankSlider); this._chooseTypeBattle = new ChooseTypeBattleView(this); addChild(this._chooseTypeBattle); this._maxNumberPlayersStepper = new NumStepper(); this._maxNumberPlayersStepper.label = CreateBattleFormLabels.stepperMaxPlayersLabel; this._maxNumberPlayersStepper.icon = CreateBattleFormController.getIcon(BattleInfoIcons.PLAYERS); this.playersWidth = this._maxNumberPlayersStepper.width; addChild(this._maxNumberPlayersStepper); this._timeLimitStepper = new NumStepper(); this._timeLimitStepper.label = CreateBattleFormLabels.stepperTimeLimitLabel; this._timeLimitStepper.icon = CreateBattleFormController.getIcon(BattleInfoIcons.TIME_LIMIT); addChild(this._timeLimitStepper); this._scoreLimitStepper = new NumStepper(); this._scoreLimitStepper.label = CreateBattleFormLabels.stepperFlagsLimitLabel; this._scoreLimitStepper.icon = CreateBattleFormController.getIcon(BattleInfoIcons.CTF); this.scoreWidth = this._scoreLimitStepper.width; addChild(this._scoreLimitStepper); this._autoBalanceCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.autoBalanceBitmapData); this._autoBalanceCheckBox.checked = true; this._autoBalanceCheckBox.label = CreateBattleFormLabels.checkBoxAutoBalanceLabel; addChild(this._autoBalanceCheckBox); this._suppliesCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.suppliesBitmapData); this._suppliesCheckBox.checked = true; this._suppliesCheckBox.label = CreateBattleFormLabels.checkBoxNoSuppliesLabel; addChild(this._suppliesCheckBox); this._dependentCooldownCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.dependentCooldownsBitmapData); this._dependentCooldownCheckBox.checked = false; this._dependentCooldownCheckBox.label = CreateBattleFormLabels.checkBoxDependentCooldownLabel; addChild(this._dependentCooldownCheckBox); this._bonusesCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.bonusesBitmapData); this._bonusesCheckBox.checked = true; this._bonusesCheckBox.label = CreateBattleFormLabels.checkBoxBonusesLabel; addChild(this._bonusesCheckBox); this._goldBoxesCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.goldBonusesBitmapData); this._goldBoxesCheckBox.checked = true; this._goldBoxesCheckBox.label = CreateBattleFormLabels.checkBoxGoldBoxesLabel; addChild(this._goldBoxesCheckBox); this._friendlyFireCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.friendlyFireBitmapData); this._friendlyFireCheckBox.label = CreateBattleFormLabels.checkBoxFriendlyFireLabel; addChild(this._friendlyFireCheckBox); this._dronesCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.droneBitmapData); this._dronesCheckBox.checked = true; this._dronesCheckBox.label = CreateBattleFormLabels.checkBoxDronesLabel; addChild(this._dronesCheckBox); this._upgradesCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.upgradesBitmapData); this._upgradesCheckBox.checked = true; this._upgradesCheckBox.label = CreateBattleFormLabels.checkBoxUpgradesLabel; addChild(this._upgradesCheckBox); this._devicesCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.devicesBitmapData); this._devicesCheckBox.checked = true; this._devicesCheckBox.label = CreateBattleFormLabels.checkBoxDevicesLabel; addChild(this._devicesCheckBox); this._privateBattleCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.privateBitmapData); this._privateBattleCheckBox.label = CreateBattleFormLabels.checkBoxPrivateBattleLabel; addChild(this._privateBattleCheckBox); this._reArmorCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.rearmorBitmapData); this._reArmorCheckBox.checked = true; this._reArmorCheckBox.label = CreateBattleFormLabels.checkBoxReArmorLabel; addChild(this._reArmorCheckBox); this._clanCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.clanVsClanBitmapData); this._clanCheckBox.checked = false; this._clanCheckBox.label = CreateBattleFormLabels.checkBoxClanLabel; addChild(this._clanCheckBox); this.ultimatesCheckBox = new CheckBoxBase(BattleParamsCheckButtonIcons.ultimatesBitmapData); this.ultimatesCheckBox.checked = true; this.ultimatesCheckBox.label = CreateBattleFormLabels.checkBoxUltimatesLabel; addChild(this.ultimatesCheckBox); this.updateUltimate(); this._chooseFormatComboBox = new DropDownList(); this._chooseFormatComboBox.setRenderer(ComboBoxRenderer); addChild(this._chooseFormatComboBox); this._battleNameTextInput = new TankInputBase(); this._battleNameTextInput.maxChars = MAX_CHARS_BATTLE_NAME; addChild(this._battleNameTextInput); this._battleNameCheckIcon = new ValidationIcon(); addChild(this._battleNameCheckIcon); this.resetProgressBattleNameCheckIcon(); this._startButton = new RedButtonBase(); this._startButton.label = CreateBattleFormLabels.startButtonLabel; addChild(this._startButton); this._chooseMapComboBox = new DropDownList(); this._chooseMapComboBox.label = CreateBattleFormLabels.mapNameLabel; addChild(this._chooseMapComboBox); this._chooseThemeMapComboBox = new DropDownList(); this._chooseThemeMapComboBox.label = CreateBattleFormLabels.themeMapNameLabel; this._chooseThemeMapComboBox.setRenderer(ComboBoxRenderer); addChild(this._chooseThemeMapComboBox); } public function setEvents() : void { display.stage.addEventListener(Event.RESIZE,this.onResize); this._battleNameTextInput.addEventListener(LoginFormEvent.TEXT_CHANGED,this.onBattleNameChange); this._battleNameTextInput.textField.addEventListener(FocusEvent.FOCUS_IN,this.onBattleNameInFocus); this._battleNameTextInput.textField.addEventListener(FocusEvent.FOCUS_OUT,this.onBattleNameOutFocus); this._chooseMapComboBox.addEventListener(Event.CHANGE,this.onMapChange); this._chooseMapComboBox.addEventListener(Event.OPEN,this.onMapComboBoxOpen); this._chooseThemeMapComboBox.addEventListener(Event.OPEN,this.onThemeComboBoxOpen); this._chooseThemeMapComboBox.addEventListener(Event.CHANGE,this.onThemeChange); this._maxNumberPlayersStepper.addEventListener(Event.CHANGE,this.onPlayersNumberChange); this._maxNumberPlayersStepper.addEventListener(MouseEvent.CLICK,this.onPlayersNumberChangeTrack); this._timeLimitStepper.addEventListener(Event.CHANGE,this.onTimeLimitChange); this._timeLimitStepper.addEventListener(MouseEvent.CLICK,this.onTimeLimitChangeTrack); this._scoreLimitStepper.addEventListener(Event.CHANGE,this.onScoreLimitChange); this._scoreLimitStepper.addEventListener(MouseEvent.CLICK,this.onScoreLimitChangeTrack); this._chooseRankSlider.addEventListener(SelectRankSliderEvent.RANK_LIMIT_CHANGED,this.onRankLimitChanged); this._startButton.addEventListener(MouseEvent.CLICK,this.onStartButtonClick); this._suppliesCheckBox.addEventListener(CheckBoxEvent.STATE_CHANGED,this.onNoSuppliesChange); this._privateBattleCheckBox.addEventListener(CheckBoxEvent.STATE_CHANGED,this.onPrivateBattleChange); this._bonusesCheckBox.addEventListener(CheckBoxEvent.STATE_CHANGED,this.onBonusesChange); this._goldBoxesCheckBox.addEventListener(CheckBoxEvent.STATE_CHANGED,this.onGoldBoxesChange); this._autoBalanceCheckBox.addEventListener(CheckBoxEvent.STATE_CHANGED,this.onAutoBalanceChange); this._reArmorCheckBox.addEventListener(CheckBoxEvent.STATE_CHANGED,this.onReArmorChange); this._upgradesCheckBox.addEventListener(CheckBoxEvent.STATE_CHANGED,this.controller.onUpgradesOrDevicesChange); this._devicesCheckBox.addEventListener(CheckBoxEvent.STATE_CHANGED,this.controller.onUpgradesOrDevicesChange); this._chooseFormatComboBox.addEventListener(Event.CHANGE,this.controller.onFormatChange); this._dependentCooldownCheckBox.addEventListener(CheckBoxEvent.STATE_CHANGED,this.controller.onDependentCooldownChange); this._friendlyFireCheckBox.addEventListener(CheckBoxEvent.STATE_CHANGED,this.onFriendlyFireChange); this._clanCheckBox.addEventListener(CheckBoxEvent.STATE_CHANGED,this.onClanChange); this.ultimatesCheckBox.addEventListener(CheckBoxEvent.STATE_CHANGED,this.controller.onUltimatesChanged); } public function removeEvents() : void { display.stage.removeEventListener(Event.RESIZE,this.onResize); this._battleNameTextInput.removeEventListener(LoginFormEvent.TEXT_CHANGED,this.onBattleNameChange); this._battleNameTextInput.textField.removeEventListener(FocusEvent.FOCUS_IN,this.onBattleNameInFocus); this._battleNameTextInput.textField.removeEventListener(FocusEvent.FOCUS_OUT,this.onBattleNameOutFocus); this._chooseMapComboBox.removeEventListener(Event.CHANGE,this.onMapChange); this._chooseMapComboBox.removeEventListener(Event.OPEN,this.onMapComboBoxOpen); this._chooseThemeMapComboBox.removeEventListener(Event.OPEN,this.onThemeComboBoxOpen); this._chooseThemeMapComboBox.removeEventListener(Event.CHANGE,this.onThemeChange); this._maxNumberPlayersStepper.removeEventListener(Event.CHANGE,this.onPlayersNumberChange); this._maxNumberPlayersStepper.removeEventListener(MouseEvent.CLICK,this.onPlayersNumberChangeTrack); this._timeLimitStepper.removeEventListener(Event.CHANGE,this.onTimeLimitChange); this._timeLimitStepper.removeEventListener(MouseEvent.CLICK,this.onTimeLimitChangeTrack); this._scoreLimitStepper.removeEventListener(Event.CHANGE,this.onScoreLimitChange); this._scoreLimitStepper.removeEventListener(MouseEvent.CLICK,this.onScoreLimitChangeTrack); this._chooseRankSlider.removeEventListener(SelectRankSliderEvent.RANK_LIMIT_CHANGED,this.onRankLimitChanged); this._startButton.removeEventListener(MouseEvent.CLICK,this.onStartButtonClick); this._suppliesCheckBox.removeEventListener(CheckBoxEvent.STATE_CHANGED,this.onNoSuppliesChange); this._privateBattleCheckBox.removeEventListener(CheckBoxEvent.STATE_CHANGED,this.onPrivateBattleChange); this._bonusesCheckBox.removeEventListener(CheckBoxEvent.STATE_CHANGED,this.onBonusesChange); this._goldBoxesCheckBox.removeEventListener(CheckBoxEvent.STATE_CHANGED,this.onGoldBoxesChange); this._autoBalanceCheckBox.removeEventListener(CheckBoxEvent.STATE_CHANGED,this.onAutoBalanceChange); this._reArmorCheckBox.removeEventListener(CheckBoxEvent.STATE_CHANGED,this.onReArmorChange); this._chooseFormatComboBox.removeEventListener(Event.CHANGE,this.controller.onFormatChange); this._dependentCooldownCheckBox.removeEventListener(CheckBoxEvent.STATE_CHANGED,this.controller.onDependentCooldownChange); this._friendlyFireCheckBox.removeEventListener(CheckBoxEvent.STATE_CHANGED,this.onFriendlyFireChange); this._upgradesCheckBox.removeEventListener(CheckBoxEvent.STATE_CHANGED,this.controller.onUpgradesOrDevicesChange); this._devicesCheckBox.removeEventListener(CheckBoxEvent.STATE_CHANGED,this.controller.onUpgradesOrDevicesChange); this.ultimatesCheckBox.removeEventListener(CheckBoxEvent.STATE_CHANGED,this.controller.onUltimatesChanged); } public function setBattleMode(param1:BattleMode) : void { this.controller.setBattleMode(param1); this.trackOnce("battleTypeChange_" + param1.name); } public function setTypeBattle(param1:BattleMode) : void { this._chooseTypeBattle.setTypeBattle(param1); var local2:Boolean = param1 != BattleMode.DM; this._autoBalanceCheckBox.visible = local2; this._friendlyFireCheckBox.visible = local2; this._clanCheckBox.visible = local2 && Boolean(clanUserInfoService.clanMember); } public function blockedStartButton() : void { this._startButton.enable = false; } public function unBlockedStartButton() : void { this._startButton.enable = true; } public function resetPrivateBattleCheckBox() : void { this._privateBattleCheckBox.checked = false; } public function get isPrivateBattle() : Boolean { return this._privateBattleCheckBox.checked; } public function get isAutoBalance() : Boolean { return this._autoBalanceCheckBox.checked; } public function get isFriendlyFire() : Boolean { return this._friendlyFireCheckBox.checked; } public function get isWithoutDrones() : Boolean { return !this._dronesCheckBox.checked; } public function get isNoSuppliesBattle() : Boolean { return !this._suppliesCheckBox.checked; } public function get isWithoutBonuses() : Boolean { return !this._bonusesCheckBox.checked; } public function get isGoldBoxesEnabled() : Boolean { return this._goldBoxesCheckBox.checked; } public function get isReArmor() : Boolean { return this._reArmorCheckBox.checked; } public function get isWithoutUpgrades() : Boolean { return !this._upgradesCheckBox.checked; } public function get isWithoutDevices() : Boolean { return !this._devicesCheckBox.checked; } public function get isDependentCooldownBattle() : Boolean { return this._dependentCooldownCheckBox.checked; } public function get isClanBattle() : Boolean { return this._clanCheckBox.checked; } public function setRankIntervalRestriction(param1:int, param2:int, param3:int) : void { this._chooseRankSlider.minValue = param1; this._chooseRankSlider.maxValue = param2; this._chooseRankSlider.tickInterval = param3; } public function setMaxRankRange(param1:int) : void { this._chooseRankSlider.maxRangRange = param1; } public function setMaxRang(param1:int) : void { this._chooseRankSlider.maxRang = param1; this._chooseRankSlider.width = this.battleInfo.width; } public function setMinRang(param1:int) : void { this._chooseRankSlider.minRang = param1; this._chooseRankSlider.width = this.battleInfo.width; } public function setCurrentRank(param1:int) : void { this._chooseRankSlider.currentRang = param1; } public function getMaxRank() : int { return this._chooseRankSlider.maxRang; } public function getMinRank() : int { return this._chooseRankSlider.minRang; } public function getMinRangValue() : int { return this._chooseRankSlider.minValue; } public function getMaxRangValue() : int { return this._chooseRankSlider.maxValue; } public function show() : void { this.setEvents(); this.onResize(null); if(!display.systemLayer.contains(this)) { display.systemLayer.addChild(this); } } public function hide() : void { this.removeEvents(); if(display.systemLayer.contains(this)) { display.systemLayer.removeChild(this); } } public function destroy() : void { this.removeEvents(); clearTimeout(this._timeOutResize); this._chooseTypeBattle.destroy(); this._chooseTypeBattle = null; this._window = null; this.battleInfo = null; this._chooseRankSlider = null; this._maxNumberPlayersStepper = null; this._timeLimitStepper = null; this._scoreLimitStepper = null; this._autoBalanceCheckBox = null; this._suppliesCheckBox = null; this._dependentCooldownCheckBox = null; this._bonusesCheckBox = null; this._goldBoxesCheckBox = null; this._upgradesCheckBox = null; this._privateBattleCheckBox = null; this._reArmorCheckBox = null; this._startButton = null; this._chooseMapComboBox = null; this._chooseThemeMapComboBox = null; this.controller = null; this._trackedEvents = null; this._chooseFormatComboBox = null; this._friendlyFireCheckBox = null; this._dronesCheckBox = null; this._clanCheckBox = null; this._battleNameTextInput = null; this._battleNameCheckIcon = null; } public function setAvailableTypesBattle(param1:Vector.<BattleMode>) : void { this._chooseTypeBattle.setAvailableTypesBattle(param1); } private function resize(param1:Boolean = true) : void { var local2:Number = this.getBackgroundWidth(); var local3:Number = this.getBackgroundHeight(); this._window.width = local2; this._window.height = local3; this.x = local2 * 2; this.y = HEADER_HEIGHT; this._chooseMapComboBox.x = 11 + this._chooseMapComboBox.getLabelWidth() + 5; this._chooseMapComboBox.y = 11; this._chooseMapComboBox.height = 274; this.resizeMapAndThemeComboBoxes(); this.battleInfo.width = local2 - 22; this.battleInfo.height = int(local3 - 520); this.battleInfo.x = 11; this.battleInfo.y = 51; this._chooseRankSlider.x = 11; this._chooseRankSlider.y = this.battleInfo.y + this.battleInfo.height + 5; this._chooseRankSlider.width = this.battleInfo.width; this._chooseTypeBattle.resize(this.battleInfo.width,this._chooseTypeBattle.getComponentHeight()); this._chooseTypeBattle.x = 11; this._chooseTypeBattle.y = this._chooseRankSlider.y + this._chooseRankSlider.height + 5; var local4:int = int((local2 - this.playersWidth - this._timeLimitStepper.width - this.scoreWidth) / 4); this._maxNumberPlayersStepper.x = local4; this._timeLimitStepper.x = this.playersWidth + local4 * 2; this._scoreLimitStepper.x = this.playersWidth + this._timeLimitStepper.width + local4 * 3; this._maxNumberPlayersStepper.y = this._timeLimitStepper.y = this._scoreLimitStepper.y = this._chooseTypeBattle.y + 71; this.updateOptions(); if(param1) { this.resizeWithDelay(); } } public function updateOptions() : void { this._privateBattleCheckBox.x = FIRST_COLUMN_X; this._privateBattleCheckBox.y = this._maxNumberPlayersStepper.y + this._maxNumberPlayersStepper.height - 11; this._bonusesCheckBox.x = FIRST_COLUMN_X; this._bonusesCheckBox.y = this._privateBattleCheckBox.y + this._privateBattleCheckBox.height + 8; this._goldBoxesCheckBox.x = FIRST_COLUMN_X; this._goldBoxesCheckBox.y = this._bonusesCheckBox.y + this._bonusesCheckBox.height + 8; this._goldBoxesCheckBox.visible = !this.getSelectedFormatItem().parkour; var local1:DisplayObject = this._goldBoxesCheckBox.visible ? this._goldBoxesCheckBox : this._bonusesCheckBox; this._suppliesCheckBox.x = FIRST_COLUMN_X; this._suppliesCheckBox.y = local1.y + local1.height + 8; this._dependentCooldownCheckBox.x = FIRST_COLUMN_X; this._dependentCooldownCheckBox.y = this._suppliesCheckBox.y + this._suppliesCheckBox.height + 8; local1 = this._dependentCooldownCheckBox.visible ? this._dependentCooldownCheckBox : this._suppliesCheckBox; this._dronesCheckBox.x = FIRST_COLUMN_X; this._dronesCheckBox.y = local1.y + local1.height + 8; this.updateDrones(); local1 = this._dronesCheckBox.visible ? this._dronesCheckBox : local1; this._friendlyFireCheckBox.x = FIRST_COLUMN_X; this._friendlyFireCheckBox.y = local1.y + local1.height + 8; local1 = this._friendlyFireCheckBox.visible ? this._friendlyFireCheckBox : local1; this._clanCheckBox.x = FIRST_COLUMN_X; this._clanCheckBox.y = local1.y + local1.height + 8; var local2:Number = this.getBackgroundWidth(); var local3:int = local2 / 2 + 5; this._chooseFormatComboBox.x = local3; this._chooseFormatComboBox.y = this._privateBattleCheckBox.y; this._chooseFormatComboBox.width = local2 - this._chooseFormatComboBox.x - RIGHT_MARGIN; this._upgradesCheckBox.x = local3; this._upgradesCheckBox.y = this._bonusesCheckBox.y; this._devicesCheckBox.x = local3; this._devicesCheckBox.y = this._upgradesCheckBox.y + this._upgradesCheckBox.height + 8; this._reArmorCheckBox.x = local3; this._reArmorCheckBox.y = this._devicesCheckBox.y + this._devicesCheckBox.height + 8; this._autoBalanceCheckBox.x = local3; this._autoBalanceCheckBox.y = this._reArmorCheckBox.y + this._reArmorCheckBox.height + 8; local1 = this._autoBalanceCheckBox.visible ? this._autoBalanceCheckBox : this._reArmorCheckBox; this.ultimatesCheckBox.x = local3; this.ultimatesCheckBox.y = local1.y + local1.height + 8; this._startButton.x = local2 - this._startButton.width - 11; this._startButton.y = this.getBackgroundHeight() - 42; this._battleNameTextInput.x = FIRST_COLUMN_X; this._battleNameTextInput.y = this._startButton.y; this._battleNameTextInput.width = this._startButton.x - FIRST_COLUMN_X - RIGHT_MARGIN; this._battleNameCheckIcon.x = this._startButton.x - 35; this._battleNameCheckIcon.y = this._startButton.y + 5; } public function setupFormatComboBoxHeight(param1:int) : void { var local2:int = 34; this._chooseFormatComboBox.height = local2 + param1 * this._chooseFormatComboBox.rowHeight; } private function getBackgroundHeight() : Number { return Math.max(display.stage.stageHeight - HEADER_HEIGHT,MIN_FLASH_HEIGHT); } private function resizeWithDelay(param1:int = 200) : void { clearTimeout(this._timeOutResize); this._timeOutResize = setTimeout(this.onResizeWithDelay,param1); } private function onResizeWithDelay() : void { this.resize(false); } public function setMapsInfo(param1:Array) : void { var local4:CreateBattleMapParams = null; this._chooseMapComboBox.clear(); var local2:int = int(param1.length); var local3:int = 0; while(local3 < local2) { local4 = param1[local3] as CreateBattleMapParams; this._chooseMapComboBox.addItem({ "index":local4.index, "gameName":local4.gameName, "id":local4.id, "minRank":local4.minRank, "maxRank":local4.maxRank, "rang":local4.currentRank, "maxPeople":local4.maxPeople, "battleModes":local4.battleModes, "matchmakingMark":local4.matchmakingMark }); local3++; } } public function setThemeInfo(param1:Array) : void { var local4:MapTheme = null; this._chooseThemeMapComboBox.clear(); var local2:int = int(param1.length); var local3:int = 0; while(local3 < local2) { local4 = param1[local3].theme; this._chooseThemeMapComboBox.addItem({ "gameName":CreateBattleFormLabels.getThemeName(local4), "themeName":param1[local3].gameName, "id":param1[local3].id, "rang":param1[local3].rang, "theme":local4, "sortIndex":local4.value }); local3++; } this._chooseThemeMapComboBox.sortOn("sortIndex",[Array.NUMERIC]); this._chooseThemeMapComboBox.height = 34 + local2 * 20; } public function selectMap(param1:String, param2:String) : void { this._chooseMapComboBox.selectItemByField(param1,param2); } public function setSelectMapThemeItemByField(param1:String, param2:String) : void { this._chooseThemeMapComboBox.selectItemByField(param1,param2); } public function getSelectMapItem() : Object { return this._chooseMapComboBox.selectedItem; } public function getSelectedThemeItem() : Object { return this._chooseThemeMapComboBox.selectedItem; } public function showThemeForMap() : void { this._isShowThemeComboBox = true; this._chooseThemeMapComboBox.visible = this._isShowThemeComboBox; this.resizeMapAndThemeComboBoxes(); } public function hideThemeForMap() : void { this._isShowThemeComboBox = false; this._chooseThemeMapComboBox.visible = this._isShowThemeComboBox; this.resizeMapAndThemeComboBoxes(); } public function setSettingsPlayersLimit(param1:int, param2:int) : void { this._maxNumberPlayersStepper.minValue = param1; this._maxNumberPlayersStepper.maxValue = param2; this._maxNumberPlayersStepper.value = param2; } public function setSettingsTimeLimit(param1:int, param2:int, param3:int) : void { this._timeLimitStepper.minValue = param1; this._timeLimitStepper.maxValue = param2; this._timeLimitStepper.value = param3; } public function setSettingsScoreLimit(param1:int, param2:int, param3:int, param4:String, param5:DisplayObject) : void { this._scoreLimitStepper.minValue = 0; this._scoreLimitStepper.maxValue = param1; this._scoreLimitStepper.value = param2; this._scoreLimitStepper.step = param3; this._scoreLimitStepper.label = param4; this._scoreLimitStepper.icon = param5; } public function setNameMaxPlayersStepper() : void { this._maxNumberPlayersStepper.label = CreateBattleFormLabels.stepperMaxPlayersLabel; } public function setNameMaxPlayersTeamStepper() : void { this._maxNumberPlayersStepper.label = CreateBattleFormLabels.stepperMaxTeamPlayersLabel; } public function getTimeLimit() : int { return this._timeLimitStepper.value; } public function getScoreLimit() : int { return this._scoreLimitStepper.value; } public function getNumberPlayers() : int { return this._maxNumberPlayersStepper.value; } private function resizeMapAndThemeComboBoxes() : void { var local1:Number = this.getBackgroundWidth(); if(this._isShowThemeComboBox) { this._chooseMapComboBox.width = int(local1 / 2 - this._chooseMapComboBox.x - 11); this._chooseThemeMapComboBox.width = int(local1 / 2 - this._chooseMapComboBox.x - 10); this._chooseThemeMapComboBox.x = int(local1 / 2 + this._chooseMapComboBox.x); } else { this._chooseMapComboBox.width = local1 - this._chooseMapComboBox.x - 11; } this._chooseThemeMapComboBox.y = 11; } private function getBackgroundWidth() : Number { return int(Math.max(MIN_FLASH_WIDTH,display.stage.stageWidth)) / 3; } private function onPrivateBattleChange(param1:CheckBoxEvent) : void { this.trackOnce("privateBattleChange"); } private function onRankLimitChanged(param1:SelectRankSliderEvent) : void { this.trackOnce("rankLimitChange"); } private function onStartButtonClick(param1:MouseEvent) : void { this.controller.onCreateBattle(); this.trackOnce("startBattle"); } private function onResize(param1:Event) : void { this.resize(); } private function onMapChange(param1:Event) : void { this.controller.onMapChange(); this.trackOnce("mapChange"); } private function onMapComboBoxOpen(param1:Event) : void { this.trackOnce("mapComboBoxOpen"); } private function onThemeComboBoxOpen(param1:Event) : void { this.trackOnce("themeComboBoxOpen"); } private function onThemeChange(param1:Event) : void { this.controller.onThemeChange(); this.trackOnce("themeChange"); } private function onPlayersNumberChange(param1:Event) : void { this.controller.onPlayersNumberChange(); } private function onTimeLimitChange(param1:Event) : void { this.controller.onTimeLimitChange(); } private function onScoreLimitChange(param1:Event) : void { this.controller.onScoreLimitChange(); } private function onNoSuppliesChange(param1:CheckBoxEvent) : void { this.trackOnce("supplyChange"); this._dependentCooldownCheckBox.visible = this._suppliesCheckBox.checked; this.updateUltimate(); this.updateOptions(); } private function onFriendlyFireChange(param1:CheckBoxEvent) : void { this.trackOnce("friendlyFireChange"); } private function onBonusesChange(param1:CheckBoxEvent) : void { this.trackOnce("bonusesChange"); this.updateUltimate(); this.updateOptions(); } private function onGoldBoxesChange(param1:CheckBoxEvent) : void { this.trackOnce("goldBoxesChange"); } private function onAutoBalanceChange(param1:CheckBoxEvent) : void { this.trackOnce("autoBalanceChange"); } private function onClanChange(param1:CheckBoxEvent) : void { this.trackOnce("clanChange"); } private function onScoreLimitChangeTrack(param1:MouseEvent) : void { this.trackOnce("scoreLimitChange"); } private function onPlayersNumberChangeTrack(param1:MouseEvent) : void { this.trackOnce("playersNumberChange"); } private function onTimeLimitChangeTrack(param1:MouseEvent) : void { this.trackOnce("timeLimitChange"); } private function onReArmorChange(param1:CheckBoxEvent) : void { this.controller.onReArmorChanged(); this.trackOnce("ReArmorChange"); } private function trackOnce(param1:String) : void { if(this._trackedEvents[param1] == null) { this._trackedEvents[param1] = true; trackerService.trackEvent(GA_CATEGORY,GA_ACTION,param1); } } public function setBattleFormats(param1:Vector.<Object>) : void { var local2:int = 0; while(local2 < param1.length) { this._chooseFormatComboBox.addItem(param1[local2]); local2++; } this.setupFormatComboBoxHeight(param1.length); } public function getSelectedFormatItem() : Object { return this._chooseFormatComboBox.selectedItem; } public function resetReArmorCheckbox() : void { this._reArmorCheckBox.setCheckedWithoutEvent(false); } public function resetUpgradesAndDevicesCheckbox() : void { this._upgradesCheckBox.setCheckedWithoutEvent(false); this._devicesCheckBox.setCheckedWithoutEvent(false); } public function selectFormatByIndex(param1:int) : void { this._chooseFormatComboBox.selectItemByField("index",param1); } public function resetDependentCooldownCheckBox() : void { this._dependentCooldownCheckBox.setCheckedWithoutEvent(false); } public function resetDronesCheckBox() : void { this._dronesCheckBox.setCheckedWithoutEvent(false); } public function isUltimatesEnabled() : Boolean { return this.ultimatesCheckBox.checked; } public function resetUltimatesCheckBox() : void { this.ultimatesCheckBox.setCheckedWithoutEvent(false); } public function showInvalidRectangleBattleName() : void { this._battleNameTextInput.validValue = false; } public function hideInvalidRectangleBattleName() : void { this._battleNameTextInput.validValue = true; } public function setBattleName(param1:String) : void { this._battleNameTextInput.value = param1; } public function getBattleName() : String { return this._battleNameTextInput.value; } public function getBattleNameLength() : int { return this._battleNameTextInput.textField.length; } private function onBattleNameChange(param1:LoginFormEvent) : void { this.controller.onBattleNameChange(); this.trackOnce("battleNameChange"); } private function onBattleNameInFocus(param1:FocusEvent) : void { this.controller.onBattleNameInFocus(); } private function onBattleNameOutFocus(param1:FocusEvent) : void { this.controller.onBattleNameOutFocus(); } public function setProgressBattleNameCheckIcon() : void { this._battleNameCheckIcon.startProgress(); } public function resetProgressBattleNameCheckIcon() : void { this._battleNameCheckIcon.turnOff(); } private function updateUltimate() : void { this.ultimatesCheckBox.visible = this.controller.battleCreateParams.ultimatesEnabled && (this._suppliesCheckBox.checked || this._bonusesCheckBox.checked); if(!this.ultimatesCheckBox.visible) { this.ultimatesCheckBox.setCheckedWithoutEvent(false); } } private function updateDrones() : void { this._dronesCheckBox.visible = this._suppliesCheckBox.checked && (this.getSelectedFormatItem().index == 0 || Boolean(this.getSelectedFormatItem().parkour)); if(!this._dronesCheckBox.visible) { this._dronesCheckBox.setCheckedWithoutEvent(false); } } } }
package projects.tanks.client.clans.clan.clanmembersdata { import alternativa.types.Long; import projects.tanks.client.clans.clan.permissions.ClanPermission; public class UserData { private var _dateInClanInSec:int; private var _deaths:int; private var _kills:int; private var _lastVisitTime:Long; private var _permission:ClanPermission; private var _score:int; private var _userId:Long; public function UserData(param1:int = 0, param2:int = 0, param3:int = 0, param4:Long = null, param5:ClanPermission = null, param6:int = 0, param7:Long = null) { super(); this._dateInClanInSec = param1; this._deaths = param2; this._kills = param3; this._lastVisitTime = param4; this._permission = param5; this._score = param6; this._userId = param7; } public function get dateInClanInSec() : int { return this._dateInClanInSec; } public function set dateInClanInSec(param1:int) : void { this._dateInClanInSec = param1; } public function get deaths() : int { return this._deaths; } public function set deaths(param1:int) : void { this._deaths = param1; } public function get kills() : int { return this._kills; } public function set kills(param1:int) : void { this._kills = param1; } public function get lastVisitTime() : Long { return this._lastVisitTime; } public function set lastVisitTime(param1:Long) : void { this._lastVisitTime = param1; } public function get permission() : ClanPermission { return this._permission; } public function set permission(param1:ClanPermission) : void { this._permission = param1; } public function get score() : int { return this._score; } public function set score(param1:int) : void { this._score = param1; } public function get userId() : Long { return this._userId; } public function set userId(param1:Long) : void { this._userId = param1; } public function toString() : String { var local1:String = "UserData ["; local1 += "dateInClanInSec = " + this.dateInClanInSec + " "; local1 += "deaths = " + this.deaths + " "; local1 += "kills = " + this.kills + " "; local1 += "lastVisitTime = " + this.lastVisitTime + " "; local1 += "permission = " + this.permission + " "; local1 += "score = " + this.score + " "; local1 += "userId = " + this.userId + " "; return local1 + "]"; } } }
package alternativa.tanks.materials { import alternativa.engine3d.alternativa3d; import alternativa.engine3d.core.Camera3D; import alternativa.engine3d.core.Object3D; import alternativa.engine3d.materials.TextureResourcesRegistry; import alternativa.gfx.core.IndexBufferResource; import alternativa.gfx.core.ProgramResource; import alternativa.gfx.core.VertexBufferResource; import flash.display.BitmapData; import flash.utils.ByteArray; import flash.utils.Dictionary; import flash.utils.getTimer; use namespace alternativa3d; public class AnimatedPaintMaterial extends PaintMaterial { private var programs:Dictionary; private var lastFrame:int = -1; private var fps:int; private var numFrames:int; private var numFramesX:int; private var numFramesY:int; private var currentFrame:Number; public var scaleX:Number; public var scaleY:Number; private var time:int; private var frameWidth:Number; private var frameHeight:Number; public function AnimatedPaintMaterial(param1:BitmapData, param2:BitmapData, param3:BitmapData, param4:int, param5:int, param6:int, param7:int, param8:int = 0) { this.programs = new Dictionary(); super(param1,param2,param3,param8); this.numFramesX = param4; this.numFramesY = param5; this.fps = param6; this.numFrames = param7; this.currentFrame = 0; this.scaleX = param3.width / param1.width; this.scaleY = param3.height / param1.height; this.frameWidth = 1 / param4; this.frameHeight = 1 / param5; fragConst = Vector.<Number>([0,0.5,1,2,this.frameWidth,this.frameHeight,0,0]); } public function update() : void { var _loc1_:int = getTimer(); var _loc2_:int = _loc1_ - this.time; this.time = _loc1_; this.currentFrame += _loc2_ / 1000 * this.fps; this.currentFrame %= this.numFrames; if(this.lastFrame == this.currentFrame) { return; } var _loc3_:int = this.currentFrame % this.numFramesX; var _loc4_:int = this.currentFrame / this.numFramesY; this.lastFrame = this.currentFrame; uvTransformConst[0] = this.scaleX; uvTransformConst[1] = 0; uvTransformConst[2] = _loc3_ * this.frameWidth; uvTransformConst[3] = 0; uvTransformConst[4] = 0; uvTransformConst[5] = this.scaleY; uvTransformConst[6] = _loc4_ * this.frameHeight; uvTransformConst[7] = 0; fragConst[6] = uvTransformConst[2]; fragConst[7] = uvTransformConst[6]; } override public function set mipMapping(param1:int) : void { _mipMapping = 0; textureResource = TextureResourcesRegistry.getTextureResource(bitmap,param1,repeat,_hardwareMipMaps); spriteSheetResource = TextureResourcesRegistry.getTextureResource(spriteSheetBitmap,false,true,false); lightMapResource = TextureResourcesRegistry.getTextureResource(lightMapBitmap,param1,true,false); } override alternativa3d function drawOpaque(param1:Camera3D, param2:VertexBufferResource, param3:IndexBufferResource, param4:int, param5:int, param6:Object3D) : void { this.update(); super.drawOpaque(param1,param2,param3,param4,param5,param6); } override alternativa3d function drawTransparent(param1:Camera3D, param2:VertexBufferResource, param3:IndexBufferResource, param4:int, param5:int, param6:Object3D, param7:Boolean = false) : void { super.drawTransparent(param1,param2,param3,param4,param5,param6,param7); } override protected function getProgram(param1:Boolean, param2:Boolean, param3:Boolean, param4:Boolean, param5:Boolean, param6:Boolean, param7:Boolean, param8:Boolean, param9:Boolean, param10:Boolean, param11:Boolean, param12:Boolean, param13:Boolean, param14:Boolean, param15:Boolean, param16:Boolean, param17:Boolean, param18:Boolean, param19:Boolean, param20:Boolean, param21:Boolean, param22:Boolean) : ProgramResource { var _loc25_:ByteArray = null; var _loc26_:ByteArray = null; var _loc23_:int = int(param1) | int(param2) << 1 | int(param3) << 2 | int(param4) << 3 | int(param5) << 4 | int(param6) << 5 | int(param7) << 6 | int(param8) << 7 | int(param9) << 8 | int(param10) << 9 | int(param11) << 10 | int(param12) << 11 | int(param13) << 12 | int(param14) << 13 | int(param15) << 14 | int(param16) << 15 | int(param17) << 16 | int(param18) << 17 | int(param19) << 18 | int(param20) << 19 | int(param21) << 20 | int(param22) << 21; var _loc24_:ProgramResource = this.programs[_loc23_]; if(_loc24_ == null) { _loc25_ = new PaintVertexShader(!param22,param14 || param11 || param12 || param17,param13,param4,param14,param10,param2,param3,param3,param19).agalcode; _loc26_ = new AnimatedPaintFragmentShader(param6,param5,param7,param15,param21,!param1 && !param16 && !param15,param8,param9,param3,param13,param11,param12,param17,param18,param14,param10,param2,param20).agalcode; _loc24_ = new ProgramResource(_loc25_,_loc26_); this.programs[_loc23_] = _loc24_; } return _loc24_; } } }
package alternativa.tanks.models.weapon { import alternativa.tanks.models.tank.TankData; public interface IWeaponController { function stopEffects(param1:TankData) : void; function reset() : void; function setLocalUser(param1:TankData) : void; function clearLocalUser() : void; function activateWeapon(param1:int) : void; function deactivateWeapon(param1:int, param2:Boolean) : void; function update(param1:int, param2:int) : Number; } }
package alternativa.tanks.service.device { import alternativa.tanks.model.item.device.ItemDevicesGarage; import alternativa.tanks.model.item.temporary.ITemporaryItem; import alternativa.tanks.service.item.ItemService; import flash.events.EventDispatcher; import flash.utils.Dictionary; import platform.client.fp10.core.resource.types.ImageResource; import platform.client.fp10.core.type.IGameClass; import platform.client.fp10.core.type.IGameObject; public class DeviceServiceImpl extends EventDispatcher implements DeviceService { [Inject] public static var itemService:ItemService; private var availableDevices:Dictionary; private var mountedDevices:Dictionary; public function DeviceServiceImpl() { super(); } public function init() : void { this.availableDevices = new Dictionary(); this.mountedDevices = new Dictionary(); } public function setAvailableDevices(param1:IGameObject, param2:Vector.<IGameObject>) : void { this.availableDevices[this.getBaseClass(param1)] = param2; } public function getAvailableDevices(param1:IGameObject) : Vector.<IGameObject> { return this.availableDevices[this.getBaseClass(param1)]; } public function getDeviceOwnType(param1:IGameObject) : DeviceOwningType { if(param1 == null || Boolean(ITemporaryItem(param1.adapt(ITemporaryItem)).isInfinityLifeTimeItem())) { return DeviceOwningType.BOUGHT; } return ITemporaryItem(param1.adapt(ITemporaryItem)).getTimeRemainingInMSec() > 0 ? DeviceOwningType.RENT : DeviceOwningType.NOT_OWNED; } public function getInsertedDevicePreview(param1:IGameObject) : ImageResource { var local2:IGameObject = this.mountedDevices[this.getBaseClass(param1)]; return local2 != null ? itemService.getPreviewResource(local2) : ItemDevicesGarage(param1.adapt(ItemDevicesGarage)).getParams().preview; } public function isDevicesAvailable(param1:IGameObject) : Boolean { if(!param1.hasModel(ItemDevicesGarage)) { return false; } return ItemDevicesGarage(param1.adapt(ItemDevicesGarage)).getParams().devicesAvailable; } public function insertDevice(param1:IGameObject, param2:IGameObject) : void { this.mountedDevices[this.getBaseClass(param1)] = param2; this.notifyDevicesStateUpdated(); } public function removeDevice(param1:IGameObject) : void { delete this.mountedDevices[this.getBaseClass(param1)]; this.notifyDevicesStateUpdated(); } public function getInsertedDevice(param1:IGameObject) : IGameObject { return this.mountedDevices[this.getBaseClass(param1)]; } private function notifyDevicesStateUpdated() : void { dispatchEvent(new UpdateDevicesEvent()); } private function getBaseClass(param1:IGameObject) : IGameClass { return itemService.getModifications(param1)[0].gameClass; } public function isSale(param1:IGameObject) : Boolean { return ItemDevicesGarage(param1.adapt(ItemDevicesGarage)).getParams().sale; } } }
package alternativa.tanks.view.mainview { import alternativa.osgi.service.display.IDisplay; import alternativa.osgi.service.locale.ILocaleService; import alternativa.tanks.controllers.mainview.MatchmakingGroupEvent; import alternativa.tanks.service.achievement.IAchievementService; import alternativa.tanks.service.matchmaking.MatchmakingGroupInviteService; import alternativa.tanks.view.mainview.grouplist.GroupList; import alternativa.tanks.view.matchmaking.quest.QuestButton; import alternativa.types.Long; import controls.TankWindowInner; import controls.base.DefaultButtonBase; import controls.buttons.IconButton; import flash.display.DisplayObjectContainer; import flash.display.Sprite; import flash.display.Stage; import flash.events.Event; import flash.events.MouseEvent; import flash.geom.Point; import flash.utils.Dictionary; import forms.TankWindowWithHeader; import projects.tanks.client.battleselect.model.matchmaking.group.notify.MatchmakingUserData; import projects.tanks.client.battleselect.model.matchmaking.group.notify.MountItemsUserData; import projects.tanks.clients.fp10.libraries.TanksLocale; import projects.tanks.clients.fp10.libraries.tanksservices.service.matchmakinggroup.MatchmakingGroupService; import projects.tanks.clients.fp10.libraries.tanksservices.service.userproperties.IUserPropertiesService; import projects.tanks.clients.fp10.libraries.tanksservices.service.userproperties.UserPropertiesServiceEvent; import services.buttonbar.IButtonBarService; public class MatchmakingLayout extends Sprite { [Inject] public static var display:IDisplay; [Inject] public static var groupInviteService:MatchmakingGroupInviteService; [Inject] public static var buttonBarService:IButtonBarService; [Inject] public static var userPropertiesService:IUserPropertiesService; [Inject] public static var matchmakingGroupService:MatchmakingGroupService; [Inject] public static var localeService:ILocaleService; [Inject] public static var achievementService:IAchievementService; private static const MIN_FLASH_WIDTH:int = 970; private static const MIN_FLASH_HEIGHT:int = 530; private static const HEADER_HEIGHT:int = 60; private static const DAILY_QUEST_BUTTON_TYPE:int = 10; private static const groupIconClass:Class = MatchmakingLayout_groupIconClass; private var window:TankWindowWithHeader; private var inner:TankWindowInner; private var groupButton:IconButton = new IconButton(localeService.getText(TanksLocale.TEXT_GROUP_BUTTON),groupIconClass); private var dailyQuestButton:IconButton = new QuestButton(); private var leaveGroupButton:DefaultButtonBase = new DefaultButtonBase(); private var groupView:GroupList = new GroupList(); private var buttonsPanel:BattleTypesPanel; private var withGroupView:Boolean = false; private var isLeader:Boolean; public function MatchmakingLayout(param1:Dictionary, param2:HolidayParams, param3:int) { super(); this.buttonsPanel = new BattleTypesPanel(param1,param2,param3); this.window = TankWindowWithHeader.createWindow(TanksLocale.TEXT_HEADER_BATTLES); addChild(this.window); this.inner = new TankWindowInner(100,100,TankWindowInner.GREEN); this.inner.showBlink = true; this.inner.x = 11; this.inner.y = 48; addChild(this.inner); this.dailyQuestButton.visible = userPropertiesService.isQuestsAvailableByRank(); this.dailyQuestButton.x = 11; this.dailyQuestButton.y = 11; this.dailyQuestButton.width = 95; addChild(this.dailyQuestButton); this.dailyQuestButton.addEventListener(MouseEvent.CLICK,this.onDailyQuestButtonClick); this.groupButton.x = this.dailyQuestButton.visible ? this.dailyQuestButton.x + this.dailyQuestButton.width + 5 : 11; this.groupButton.y = this.dailyQuestButton.y; this.groupButton.width = 95; addChild(this.groupButton); this.groupButton.visible = userPropertiesService.canUseGroup(); this.groupButton.addEventListener(MouseEvent.CLICK,this.onCreateGroupClick); this.buttonsPanel.setSpectatorsButtonVisible(userPropertiesService.hasSpectatorPermissions()); this.leaveGroupButton.y = 11; this.leaveGroupButton.width = 110; this.leaveGroupButton.label = localeService.getText(TanksLocale.TEXT_LEAVE_GROUP_BUTTON); addChild(this.leaveGroupButton); this.leaveGroupButton.addEventListener(MouseEvent.CLICK,this.onLeaveGroupClick); this.leaveGroupButton.visible = false; this.inner.addChild(this.groupView); this.groupView.x = 11; this.groupView.y = 12; this.groupView.visible = false; this.inner.addChild(this.buttonsPanel); userPropertiesService.addEventListener(UserPropertiesServiceEvent.UPDATE_RANK,this.onUpdateRank); userPropertiesService.addEventListener(UserPropertiesServiceEvent.ON_INIT_USER_PROPERTIES,this.onInitProperties); } private function onInitProperties(param1:UserPropertiesServiceEvent) : void { userPropertiesService.removeEventListener(UserPropertiesServiceEvent.ON_INIT_USER_PROPERTIES,this.onInitProperties); this.groupButton.visible = userPropertiesService.canUseGroup(); this.buttonsPanel.setSpectatorsButtonVisible(userPropertiesService.hasSpectatorPermissions()); } private function onUpdateRank(param1:UserPropertiesServiceEvent) : void { if(userPropertiesService.isQuestsAvailableByRank()) { userPropertiesService.removeEventListener(UserPropertiesServiceEvent.UPDATE_RANK,this.onUpdateRank); this.dailyQuestButton.visible = true; this.groupButton.x = this.dailyQuestButton.x + this.dailyQuestButton.width + 5; } this.groupButton.visible = userPropertiesService.canUseGroup(); } public function show() : void { if(!this.getContainer().contains(this)) { this.resize(); this.setEvents(); this.getContainer().addChild(this); } } public function hide() : void { if(this.getContainer().contains(this)) { this.removeEvents(); this.hideGroupView(); this.getContainer().removeChild(this); achievementService.setBattleStartButtonTargetPoint(new Point(-1000,-1000)); } } public function showGroupView(param1:Vector.<MatchmakingUserData>, param2:Boolean) : void { this.withGroupView = true; this.leaveGroupButton.visible = true; this.groupButton.enabled = false; this.groupView.fillMembersList(param1); this.groupView.visible = true; this.isLeader = param2; this.buttonsPanel.userEntersGroup(param2 && this.allUsersReadyForBattle(param1)); this.resize(); } public function hideGroupView() : void { this.withGroupView = false; this.leaveGroupButton.visible = false; this.groupButton.enabled = true; this.groupView.removeAllUsers(); this.groupView.visible = false; this.buttonsPanel.userLeavesGroup(); this.resize(); } public function addUserToGroup(param1:MatchmakingUserData) : void { this.groupView.addUser(param1); } public function removeUserFromGroup(param1:Long) : void { this.groupView.removeUser(param1); this.tryUnlockBattleButtons(); } public function showUserReady(param1:Long) : void { this.groupView.showUserReady(param1); this.tryUnlockBattleButtons(); } private function tryUnlockBattleButtons() : void { if(this.groupView.isEveryoneReady() && this.isLeader) { this.buttonsPanel.unlockBattleButtons(); } } public function showUserNotReady(param1:Long) : void { this.groupView.showUserNotReady(param1); this.buttonsPanel.lockBattleButtons(); } public function updateMountedItem(param1:MountItemsUserData) : void { this.groupView.updateMountedItem(param1); } private function onCreateGroupClick(param1:MouseEvent) : void { this.groupButton.enabled = false; dispatchEvent(new MatchmakingGroupEvent(MatchmakingGroupEvent.CREATE)); } private function onDailyQuestButtonClick(param1:MouseEvent) : void { buttonBarService.change(DAILY_QUEST_BUTTON_TYPE); } private function onLeaveGroupClick(param1:MouseEvent) : void { matchmakingGroupService.removeUsers(); this.leaveGroupButton.enabled = false; dispatchEvent(new MatchmakingGroupEvent(MatchmakingGroupEvent.LEAVE)); } private function setEvents() : void { this.getStage().addEventListener(Event.RESIZE,this.onResize); } private function removeEvents() : void { this.getStage().removeEventListener(Event.RESIZE,this.onResize); } private function onResize(param1:Event) : void { this.resize(); } private function resize() : void { var local1:int = Math.max(MIN_FLASH_WIDTH,this.getStage().stageWidth) / 3 * 2; var local2:int = Math.max(this.getStage().stageHeight - HEADER_HEIGHT,MIN_FLASH_HEIGHT); this.window.width = local1; this.window.height = local2; this.x = local1 / 2; this.y = HEADER_HEIGHT; this.inner.width = local1 - 22; this.inner.height = local2 - 63; this.leaveGroupButton.x = this.window.width - this.leaveGroupButton.width - 11; this.groupView.resize(local1 - 44,125); this.buttonsPanel.resize(local1 - 17,local2 - 69 - (this.withGroupView ? 137 : 0)); this.buttonsPanel.x = 0; this.buttonsPanel.y = this.withGroupView ? 135 : 3; } private function getContainer() : DisplayObjectContainer { return display.systemLayer; } private function getStage() : Stage { return display.stage; } private function allUsersReadyForBattle(param1:Vector.<MatchmakingUserData>) : Boolean { var local2:MatchmakingUserData = null; for each(local2 in param1) { if(!local2.userIsReady) { return false; } } return true; } } }
package alternativa.tanks.controller.events.showform { import flash.events.Event; public class ShowExternalEntranceFormEvent extends Event { public static const REGISTRATION_FORM:String = "ShowExternalEntranceFormEvent.REGISTRATION_FORM"; public static const LOGIN_FORM:String = "ShowExternalEntranceFormEvent.LOGIN_FORM"; public var loginCaptchaEnabled:Boolean; public var presetCallsign:String; public var socialNetworkId:String; public function ShowExternalEntranceFormEvent(param1:String, param2:String, param3:String, param4:Boolean) { this.socialNetworkId = param2; this.presetCallsign = param3; this.loginCaptchaEnabled = param4; super(param1); } override public function clone() : Event { return new ShowExternalEntranceFormEvent(type,this.socialNetworkId,this.presetCallsign,this.loginCaptchaEnabled); } } }
package alternativa.tanks.gui { import alternativa.init.Main; import alternativa.model.IModel; import alternativa.model.IResourceLoadListener; import alternativa.object.ClientObject; import alternativa.osgi.service.locale.ILocaleService; import alternativa.service.IModelService; import alternativa.service.IResourceService; import alternativa.tanks.locale.constants.TextConst; import alternativa.tanks.model.banner.IBanner; import alternativa.types.Long; import assets.icons.GarageItemBackground; import assets.icons.InputCheckIcon; import controls.DefaultButton; import controls.Label; import controls.TankWindow; import controls.TankWindowHeader; import controls.TankWindowInner; import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.Sprite; import flash.events.MouseEvent; import flash.geom.Point; import flash.net.URLRequest; import flash.net.navigateToURL; import flash.ui.Mouse; import flash.ui.MouseCursor; import forms.RegisterForm; import projects.tanks.client.panel.model.bonus.BonusItem; import scpacker.resource.ResourceType; import scpacker.resource.ResourceUtil; import scpacker.resource.images.ImageResource; import specter.utils.Logger; public class CongratulationsWindowWithBanner extends Sprite implements IResourceLoadListener { private var window:TankWindow; private var inner:TankWindowInner; public var closeButton:DefaultButton; private var messageLabel:Label; private var windowSize:Point; private var windowWidth:int = 450; private const windowMargin:int = 12; private const margin:int = 9; private const buttonSize:Point = new Point(104,33); private const space:int = 8; private var bannerObject:ClientObject; private var bannerContainer:Sprite; private var bannerBmp:Bitmap; private var bannerURL:String; private var itemsContainer:Sprite; private var items:Array; private var message:String; public function CongratulationsWindowWithBanner(message:String, items:Array, bannerObject:ClientObject) { super(); this.init(message,items,bannerObject); } private function init(message:String, items:Array, bannerObject:ClientObject) : void { var numColons:int = 0; var previewId:String = null; var previewBd:BitmapData = null; var iconCheck:InputCheckIcon = null; var imageResource:ImageResource = null; var numLabel:Label = null; var preview:Bitmap = null; var modelRegister:IModelService = null; var bannerModel:IBanner = null; this.items = items; this.message = message; var bg:GarageItemBackground = new GarageItemBackground(GarageItemBackground.ENGINE_NORMAL); var localeService:ILocaleService = ILocaleService(Main.osgi.getService(ILocaleService)); var evenNumberItems:Boolean = (items.length & 1) == 0; if(items.length == 1) { numColons = 1; } else if(items.length < 5) { numColons = 2; } else { numColons = 3; } this.bannerContainer = new Sprite(); this.itemsContainer = new Sprite(); this.bannerBmp = new Bitmap(); this.bannerContainer.addChild(this.bannerBmp); this.windowWidth = bg.width + this.windowMargin * 2 + this.margin * 2 + (bg.width + this.space) * (numColons - 1); var resourceService:IResourceService = IResourceService(Main.osgi.getService(IResourceService)); this.messageLabel = new Label(); this.messageLabel.wordWrap = true; this.messageLabel.multiline = true; this.messageLabel.text = message; this.messageLabel.size = 12; this.messageLabel.color = 5898034; this.messageLabel.x = this.windowMargin * 2; this.messageLabel.y = this.windowMargin * 2; this.messageLabel.width = this.windowWidth - this.windowMargin * 4; this.windowSize = new Point(this.windowWidth,this.messageLabel.height + this.buttonSize.y + this.windowMargin * 3 + this.margin * 3); this.window = new TankWindow(this.windowSize.x,this.windowSize.y); addChild(this.window); this.window.headerLang = ILocaleService(Main.osgi.getService(ILocaleService)).getText(TextConst.GUI_LANG); this.window.header = TankWindowHeader.CONGRATULATIONS; this.inner = new TankWindowInner(0,0,TankWindowInner.GREEN); addChild(this.inner); this.inner.x = this.windowMargin; this.inner.y = this.windowMargin; this.inner.width = this.windowSize.x - this.windowMargin * 2; this.inner.height = this.windowSize.y - this.windowMargin - this.margin * 2 - this.buttonSize.y + 2; addChild(this.messageLabel); addChild(this.itemsContainer); for(var i:int = 0; i < items.length; i++) { iconCheck = new InputCheckIcon(); bg = new GarageItemBackground(GarageItemBackground.ENGINE_NORMAL); this.itemsContainer.addChild(bg); previewId = String(BonusItem(items[i]).resource) + "_m0_preview"; imageResource = ImageResource(ResourceUtil.getResource(ResourceType.IMAGE,previewId)); bg.x = (!evenNumberItems && i > items.length - numColons ? bg.width + this.space >> 1 : 0) + int(i % numColons) * (bg.width + this.space); bg.y = (bg.height + this.space) * int(i / numColons); if(imageResource == null) { this.itemsContainer.addChild(iconCheck); iconCheck.x = bg.x + (bg.width - iconCheck.width >> 1); iconCheck.y = bg.y + (bg.height - iconCheck.height >> 1); iconCheck.gotoAndStop(RegisterForm.CALLSIGN_STATE_INVALID); } else if(!imageResource.loaded()) { this.itemsContainer.addChild(iconCheck); iconCheck.x = bg.x + (bg.width - iconCheck.width >> 1); iconCheck.y = bg.y + (bg.height - iconCheck.height >> 1); iconCheck.gotoAndStop(RegisterForm.CALLSIGN_STATE_PROGRESS); imageResource.completeLoadListener = this; imageResource.load(); } else { previewBd = imageResource.bitmapData as BitmapData; preview = new Bitmap(previewBd); this.itemsContainer.addChild(preview); preview.x = bg.x + (bg.width - preview.width >> 1); preview.y = bg.y + (bg.height - preview.height >> 1); } numLabel = new Label(); this.itemsContainer.addChild(numLabel); numLabel.size = 16; numLabel.color = 5898034; numLabel.text = "×" + BonusItem(items[i]).count.toString(); numLabel.x = bg.x + bg.width - numLabel.width - 15; numLabel.y = bg.y + bg.height - numLabel.height - 10; } this.windowSize.y += this.itemsContainer.height; if(this.closeButton == null) { this.closeButton = new DefaultButton(); } addChild(this.closeButton); this.closeButton.label = ILocaleService(Main.osgi.getService(ILocaleService)).getText(TextConst.FREE_BONUSES_WINDOW_BUTTON_CLOSE_TEXT); this.closeButton.y = this.windowSize.y - this.margin - this.buttonSize.y - 2; this.placeItems(); addChild(this.bannerContainer); this.window.height = this.windowSize.y; this.window.width = this.windowSize.x; if(bannerObject != null) { this.bannerObject = bannerObject; modelRegister = Main.osgi.getService(IModelService) as IModelService; bannerModel = (modelRegister.getModelsByInterface(IBanner) as Vector.<IModel>)[0] as IBanner; this.bannerBd = bannerModel.getBannerBd(bannerObject); this.bannerURL = bannerModel.getBannerURL(bannerObject); this.bannerContainer.addEventListener(MouseEvent.CLICK,this.onBannerClick); this.bannerContainer.buttonMode = true; } } public function resourceLoaded(resource:Object) : void { var i:int = 0; try { for(i = 0; i < super.numChildren; i++) { super.removeChildAt(i); } this.init(this.message,this.items,null); } catch(e:Error) { Logger.warn("resourceLoaded()" + e.getStackTrace()); } } public function resourceUnloaded(resourceId:Long) : void { } private function placeItems() : void { this.messageLabel.width = this.windowWidth - this.windowMargin * 4; this.itemsContainer.y = this.messageLabel.y + this.messageLabel.height + this.windowMargin; this.itemsContainer.x = this.windowSize.x - this.itemsContainer.width >> 1; this.inner.width = this.windowSize.x - this.windowMargin * 2; this.inner.height = this.windowSize.y - this.windowMargin - this.margin * 2 - this.buttonSize.y + 2; this.closeButton.x = this.windowSize.x - this.buttonSize.x >> 1; } public function set bannerBd(value:BitmapData) : void { this.bannerBmp.bitmapData = value; this.windowSize.y = this.windowSize.y + this.bannerBmp.height + this.margin - 1; this.windowWidth = this.windowSize.x = Math.max(this.windowSize.x,this.bannerBmp.width + this.windowMargin * 2 + this.margin * 2); this.window.height = this.windowSize.y; this.window.width = this.windowSize.x; this.placeItems(); this.bannerBmp.x = this.windowWidth - this.bannerBmp.width >> 1; this.bannerBmp.y = this.inner.y + this.inner.height - this.margin - this.bannerBmp.height - 1; this.closeButton.y = this.windowSize.y - this.margin - this.buttonSize.y - 2; } public function get banner() : Bitmap { return this.bannerBmp; } private function onBannerOver(e:MouseEvent) : void { Mouse.cursor = MouseCursor.HAND; } private function onBannerOut(e:MouseEvent) : void { Mouse.cursor = MouseCursor.ARROW; } private function onBannerClick(e:MouseEvent) : void { Main.writeVarsToConsoleChannel("BannerModel","onBannerClick"); navigateToURL(new URLRequest(this.bannerURL),"_blank"); var modelRegister:IModelService = Main.osgi.getService(IModelService) as IModelService; var bannerModel:IBanner = (modelRegister.getModelsByInterface(IBanner) as Vector.<IModel>)[0] as IBanner; bannerModel.click(this.bannerObject); } } }
package platform.client.fp10.core.resource.types { import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.Loader; import flash.events.ErrorEvent; import flash.events.Event; import flash.events.IOErrorEvent; import flash.events.ProgressEvent; import flash.events.SecurityErrorEvent; import flash.net.URLLoaderDataFormat; import flash.net.URLRequest; import flash.utils.ByteArray; import mx.graphics.codec.PNGEncoder; import platform.client.fp10.core.resource.IResourceLoadingListener; import platform.client.fp10.core.resource.IResourceSerializationListener; import platform.client.fp10.core.resource.Resource; import platform.client.fp10.core.resource.ResourceFlags; import platform.client.fp10.core.resource.ResourceInfo; import platform.client.fp10.core.resource.SafeURLLoader; import platform.client.fp10.core.service.localstorage.IResourceLocalStorage; public class TextureResource extends Resource { [Inject] public static var resourceLocalStorage:IResourceLocalStorage; private static const IMAGE_FILE:String = "image.tnk"; private static const BINARY_VERSION:int = 1; private var loader:SafeURLLoader; private var _data:BitmapData; public function TextureResource(param1:ResourceInfo) { super(param1); } public function get data() : BitmapData { return this._data; } override public function get description() : String { return "Image"; } override public function loadBytes(param1:ByteArray, param2:IResourceLoadingListener) : Boolean { if(param1.bytesAvailable < 2 || param1.readByte() != BINARY_VERSION) { return false; } this.listener = param2; var local3:int = param1.readInt(); var local4:ByteArray = new ByteArray(); param1.readBytes(local4,param1.position,local3); this.loadImage(param1); return true; } override public function serialize(param1:IResourceSerializationListener) : void { var local2:ByteArray = new ByteArray(); local2.writeByte(BINARY_VERSION); var local3:ByteArray = new PNGEncoder().encode(this._data); local2.writeInt(local3.length); local2.writeBytes(local3); param1.onSerializationComplete(this,local2); } override public function load(param1:String, param2:IResourceLoadingListener) : void { super.load(param1,param2); this.loadImageBytes(); } override protected function doReload() : void { this.loader.close(); this.loadImageBytes(); } override protected function createDummyData() : Boolean { this._data = new StubBitmapData(16711680); return true; } protected function getImageFileName() : String { return IMAGE_FILE; } private function loadImageBytes() : void { this.loader = this.createLoader(); this.loader.load(new URLRequest(baseUrl + this.getImageFileName())); startTimeoutTracking(); status = "Image requested"; } private function onLoadingComplete(param1:Event) : void { stopTimeoutTracking(); this.loadImage(param1.target.data); } private function loadImage(param1:ByteArray) : void { var local2:Loader = new Loader(); local2.contentLoaderInfo.addEventListener(Event.COMPLETE,this.completeLoadImage); local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,this.onLoadingError); local2.loadBytes(param1); } private function completeLoadImage(param1:Event) : void { this._data = Bitmap(param1.target.content).bitmapData; this.completeLoading(); } override protected function completeLoading() : void { super.completeLoading(); this.loader = null; baseUrl = null; } private function onLoadingOpen(param1:Event) : void { updateLastActivityTime(); listener.onResourceLoadingStart(this); } private function onLoadingError(param1:ErrorEvent) : void { stopTimeoutTracking(); this._data = new StubBitmapData(16711680); setFlags(ResourceFlags.LOADED); baseUrl = null; listener.onResourceLoadingError(this,param1.toString()); } private function onLoadingProgress(param1:ProgressEvent) : void { updateLastActivityTime(); } private function createLoader() : SafeURLLoader { var local1:SafeURLLoader = new SafeURLLoader(); local1.dataFormat = URLLoaderDataFormat.BINARY; local1.addEventListener(Event.OPEN,this.onLoadingOpen); local1.addEventListener(ProgressEvent.PROGRESS,this.onLoadingProgress); local1.addEventListener(Event.COMPLETE,this.onLoadingComplete); local1.addEventListener(IOErrorEvent.IO_ERROR,this.onLoadingError); local1.addEventListener(SecurityErrorEvent.SECURITY_ERROR,this.onLoadingError); return local1; } } }
package alternativa.protocol.codec.complex { import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.impl.LengthCodecHelper; import flash.utils.ByteArray; public class StringCodec implements ICodec { public function StringCodec() { super(); } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local3:ByteArray = new ByteArray(); local3.writeUTFBytes(String(param2)); var local4:int = int(local3.length); LengthCodecHelper.encodeLength(param1,local4); param1.writer.writeBytes(local3,0,local4); } public function decode(param1:ProtocolBuffer) : Object { var local2:int = LengthCodecHelper.decodeLength(param1); return param1.reader.readUTFBytes(local2); } public function init(param1:IProtocol) : void { } } }
package alternativa.tanks.models.battle.gui.gui.statistics.messages { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.models.battle.gui.gui.statistics.messages.ActionOutputLine_playerGoldBoxIcon.png")] public class ActionOutputLine_playerGoldBoxIcon extends BitmapAsset { public function ActionOutputLine_playerGoldBoxIcon() { super(); } } }
package alternativa.tanks.camera { import alternativa.math.Vector3; import alternativa.tanks.vehicles.tanks.Tank; public interface IFollowCameraController extends ICameraController { function get cameraHeight() : Number; function set cameraHeight(param1:Number) : void; function deactivate() : void; function activate() : void; function setLocked(param1:Boolean) : void; function initByTarget(param1:Vector3, param2:Vector3) : void; function set tank(param1:Tank) : void; function get tank() : Tank; function addModifier(param1:ICameraStateModifier) : void; function initCameraComponents() : void; function getCameraState(param1:Vector3, param2:Vector3, param3:Vector3, param4:Vector3) : void; } }
package projects.tanks.client.garage.models.item.fitting { public interface IItemFittingModelBase { } }
package alternativa.osgi.bundle { import alternativa.utils.Properties; public interface IBundleDescriptor { function get name() : String; function get activators() : Vector.<IBundleActivator>; function get properties() : Properties; } }
package alternativa.tanks.models.dom.cp { import alternativa.engine3d.materials.TextureMaterial; import alternativa.engine3d.objects.Sprite3D; import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Matrix; import flash.geom.Rectangle; public class ControlPointSprite extends Sprite3D { [Embed(source="1174.png")] private static const alphaC:Class; [Embed(source="1198.png")] private static const blueC:Class; [Embed(source="1102.png")] private static const redC:Class; [Embed(source="1197.png")] private static const noneC:Class; [Embed(source="773.png")] private static const charsC:Class; public static const BALANCE_ABS:int = 100; public static const BALANCE_NONE:int = 0; public static const BALANCE_RED:int = -100; public static const BALANCE_BLUE:int = 100; public static const blues:BitmapData = (new blueC() as Bitmap).bitmapData; public static const reds:BitmapData = (new redC() as Bitmap).bitmapData; public static const nones:BitmapData = (new noneC() as Bitmap).bitmapData; public static const chars:BitmapData = (new charsC() as Bitmap).bitmapData; public static const w:int = nones.width; public static const h:int = nones.height; public static const abds:BitmapData = (new alphaC() as Bitmap).bitmapData; public static var abd:BitmapData; public static var red:BitmapData; public static var blue:BitmapData; public static var none:BitmapData; public var progress:Number = 0; public var tm:TextureMaterial; public var currChar:int = 0; public var mask:DrawMask; public function ControlPointSprite(pointId:int) { this.mask = new DrawMask(w); super(w,h); this.currChar = pointId; material = this.tm = new TextureMaterial(none,false,false); scaleX = scaleY = scaleZ = 2; } public static function init() : void { prepareAbd(); red = getTexture(reds); blue = getTexture(blues); none = getTexture(nones); } public static function destroy() : void { red.dispose(); blue.dispose(); none.dispose(); red = blue = none = null; } public static function prepareAbd() : void { var _loc1_:uint = 0; var _loc3_:int = 0; abd = new BitmapData(w,h,true); var _loc2_:int = 0; while(_loc2_ < w) { _loc3_ = 0; while(_loc3_ < h) { _loc1_ = abds.getPixel32(_loc2_,_loc3_); _loc1_ <<= 24; abd.setPixel32(_loc2_,_loc3_,_loc1_); _loc3_++; } _loc2_++; } } public static function getTexture(param1:BitmapData) : BitmapData { var _loc3_:uint = 0; var _loc4_:uint = 0; var _loc5_:uint = 0; var _loc6_:uint = 0; var _loc7_:uint = 0; var _loc9_:int = 0; var _loc2_:BitmapData = new BitmapData(param1.width,param1.height,true); var _loc8_:int = 0; while(_loc8_ < w) { _loc9_ = 0; while(_loc9_ < h) { _loc3_ = abd.getPixel32(_loc8_,_loc9_); _loc4_ = param1.getPixel32(_loc8_,_loc9_); _loc3_ = _loc3_ >> 24 & 255; _loc5_ = _loc4_ >> 16 & 255; _loc6_ = _loc4_ >> 8 & 255; _loc7_ = _loc4_ & 255; _loc4_ = _loc3_ << 24 | _loc5_ << 16 | _loc6_ << 8 | _loc7_; _loc2_.setPixel32(_loc8_,_loc9_,_loc4_); _loc9_++; } _loc8_++; } return _loc2_; } public function drawChar(param1:BitmapData) : void { var _loc2_:Matrix = new Matrix(); _loc2_.translate(96 - 64 * this.currChar,96); param1.draw(chars,_loc2_,null,null,new Rectangle(96,96,64,64)); } public function redraw() : void { var _loc1_:BitmapData = new BitmapData(w,h,true,0); if(this.progress < -100) { this.progress = -100; } else if(this.progress > 100) { this.progress = 100; } if(this.progress == BALANCE_NONE) { _loc1_.draw(none); this.drawChar(_loc1_); this.tm.texture = _loc1_; return; } if(this.progress == BALANCE_RED) { _loc1_.draw(red); this.drawChar(_loc1_); this.tm.texture = _loc1_; return; } if(this.progress == BALANCE_BLUE) { _loc1_.draw(blue); this.drawChar(_loc1_); this.tm.texture = _loc1_; return; } if(this.progress < 0) { _loc1_.draw(none); this.mask.drawMaskPoint(red,1 + this.progress / BALANCE_ABS); _loc1_.draw(this.mask); this.drawChar(_loc1_); this.tm.texture = _loc1_; } else { _loc1_.draw(none); this.mask.drawMaskPoint(blue,1 - this.progress / BALANCE_ABS); _loc1_.draw(this.mask); this.drawChar(_loc1_); this.tm.texture = _loc1_; } } } }