code
stringlengths 57
237k
|
|---|
package alternativa.tanks.models.weapon.shotgun.aiming {
import alternativa.tanks.models.weapon.shotgun.PelletDirectionCalculator;
import alternativa.tanks.models.weapon.shotgun.ShotgunRicochetTargetingSystem;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class ShotgunAimingEvents implements ShotgunAiming {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function ShotgunAimingEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function createTargetingSystem() : ShotgunRicochetTargetingSystem {
var result:ShotgunRicochetTargetingSystem = null;
var i:int = 0;
var m:ShotgunAiming = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = ShotgunAiming(this.impl[i]);
result = m.createTargetingSystem();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
public function getPelletDirectionCalculator() : PelletDirectionCalculator {
var result:PelletDirectionCalculator = null;
var i:int = 0;
var m:ShotgunAiming = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = ShotgunAiming(this.impl[i]);
result = m.getPelletDirectionCalculator();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
}
}
|
package alternativa.tanks.help
{
import alternativa.init.Main;
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.locale.constants.TextConst;
public class RankHelper extends BubbleHelper
{
public function RankHelper()
{
super();
var localeService:ILocaleService = ILocaleService(Main.osgi.getService(ILocaleService));
text = localeService.getText(TextConst.HELP_PANEL_RANK_HELPER_TEXT);
arrowLehgth = int(localeService.getText(TextConst.HELP_PANEL_RANK_HELPER_ARROW_LENGTH));
arrowAlign = HelperAlign.TOP_LEFT;
_showLimit = 3;
_targetPoint.x = 29;
_targetPoint.y = 42;
}
}
}
|
package projects.tanks.client.battlefield.models.tankparts.weapon.laser {
public class LaserPointerCC {
private var _fadeInTimeMs:int;
private var _laserPointerBlueColor:String;
private var _laserPointerRedColor:String;
private var _locallyVisible:Boolean;
public function LaserPointerCC(param1:int = 0, param2:String = null, param3:String = null, param4:Boolean = false) {
super();
this._fadeInTimeMs = param1;
this._laserPointerBlueColor = param2;
this._laserPointerRedColor = param3;
this._locallyVisible = param4;
}
public function get fadeInTimeMs() : int {
return this._fadeInTimeMs;
}
public function set fadeInTimeMs(param1:int) : void {
this._fadeInTimeMs = param1;
}
public function get laserPointerBlueColor() : String {
return this._laserPointerBlueColor;
}
public function set laserPointerBlueColor(param1:String) : void {
this._laserPointerBlueColor = param1;
}
public function get laserPointerRedColor() : String {
return this._laserPointerRedColor;
}
public function set laserPointerRedColor(param1:String) : void {
this._laserPointerRedColor = param1;
}
public function get locallyVisible() : Boolean {
return this._locallyVisible;
}
public function set locallyVisible(param1:Boolean) : void {
this._locallyVisible = param1;
}
public function toString() : String {
var local1:String = "LaserPointerCC [";
local1 += "fadeInTimeMs = " + this.fadeInTimeMs + " ";
local1 += "laserPointerBlueColor = " + this.laserPointerBlueColor + " ";
local1 += "laserPointerRedColor = " + this.laserPointerRedColor + " ";
local1 += "locallyVisible = " + this.locallyVisible + " ";
return local1 + "]";
}
}
}
|
package controls.base {
public class MainPanelBattlesButtonBase extends MainPanelButtonBase {
private var iconClass:Class = MainPanelBattlesButtonBase_iconClass;
public function MainPanelBattlesButtonBase() {
super(this.iconClass);
}
}
}
|
package alternativa.tanks.models.weapon.railgun {
import alternativa.math.Vector3;
import alternativa.physics.Body;
import alternativa.tanks.battle.BattleService;
import alternativa.tanks.battle.BattleUtils;
import alternativa.tanks.battle.events.BattleEventDispatcher;
import alternativa.tanks.battle.events.BattleEventSupport;
import alternativa.tanks.battle.events.StateCorrectionEvent;
import alternativa.tanks.battle.events.TankAddedToBattleEvent;
import alternativa.tanks.battle.events.TankRemovedFromBattleEvent;
import alternativa.tanks.battle.events.TankUnloadedEvent;
import alternativa.tanks.battle.objects.tank.Tank;
import alternativa.tanks.battle.objects.tank.Weapon;
import alternativa.tanks.models.tank.ITankModel;
import alternativa.tanks.models.tank.ultimate.hunter.stun.UltimateStunListener;
import alternativa.tanks.models.weapon.IWeaponModel;
import alternativa.tanks.models.weapon.WeaponForces;
import alternativa.tanks.models.weapon.WeaponObject;
import alternativa.tanks.models.weapon.common.IWeaponCommonModel;
import alternativa.tanks.models.weapon.common.WeaponBuffListener;
import alternativa.tanks.models.weapon.common.WeaponCommonData;
import alternativa.tanks.models.weapon.shared.SimpleWeaponController;
import alternativa.tanks.models.weapon.shared.shot.WeaponReloadTimeChangedListener;
import alternativa.tanks.models.weapons.targeting.PenetratingTargetingSystem;
import alternativa.tanks.models.weapons.targeting.TargetingSystem;
import flash.utils.Dictionary;
import platform.client.fp10.core.model.ObjectLoadListener;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.client.battlefield.models.tankparts.weapon.railgun.IRailgunModelBase;
import projects.tanks.client.battlefield.models.tankparts.weapon.railgun.RailgunCC;
import projects.tanks.client.battlefield.models.tankparts.weapon.railgun.RailgunModelBase;
import projects.tanks.client.battlefield.types.Vector3d;
[ModelInfo]
public class RailgunModel extends RailgunModelBase implements IRailgunModelBase, ObjectLoadListener, IWeaponModel, UltimateStunListener, WeaponReloadTimeChangedListener, RailgunCallback, WeaponBuffListener {
[Inject]
public static var battleService:BattleService;
[Inject]
public static var battleEventDispatcher:BattleEventDispatcher;
private var weapons:Dictionary = new Dictionary();
private var tanksOnField:Dictionary = new Dictionary();
private var battleEventSupport:BattleEventSupport;
private var localWeapon:RailgunWeapon;
public function RailgunModel() {
super();
this.initBattleEventListeners();
}
private static function getWeaponCommonData() : WeaponCommonData {
var local1:IWeaponCommonModel = IWeaponCommonModel(object.adapt(IWeaponCommonModel));
return local1.getCommonData();
}
private static function getWeaponObject() : WeaponObject {
return new WeaponObject(object);
}
private static function getEffects() : IRailgunEffects {
var local1:IRailgunSFXModel = IRailgunSFXModel(object.adapt(IRailgunSFXModel));
return local1.getEffects();
}
private static function convertHitPoints(param1:Vector.<Vector3d>) : Vector.<Vector3> {
var local2:Vector.<Vector3> = null;
var local3:int = 0;
var local4:Vector3d = null;
if(param1 != null) {
local2 = new Vector.<Vector3>(param1.length);
local3 = 0;
while(local3 < param1.length) {
local4 = param1[local3];
if(!BattleUtils.isFiniteVector3d(local4)) {
return null;
}
local2[local3] = BattleUtils.getVector3(local4);
local3++;
}
return local2;
}
return null;
}
private static function convertTargets(param1:Vector.<IGameObject>, param2:Dictionary) : Vector.<Body> {
var local3:Vector.<Body> = null;
var local4:int = 0;
var local5:Tank = null;
if(param1 != null) {
local3 = new Vector.<Body>(param1.length);
local4 = 0;
while(local4 < param1.length) {
local5 = param2[param1[local4]];
if(local5 == null) {
local3[local4] = null;
} else {
local3[local4] = local5.getBody();
}
local4++;
}
return local3;
}
return null;
}
private function initBattleEventListeners() : void {
this.battleEventSupport = new BattleEventSupport(battleEventDispatcher);
this.battleEventSupport.addEventHandler(TankAddedToBattleEvent,this.onTankAddedToBattle);
this.battleEventSupport.addEventHandler(TankRemovedFromBattleEvent,this.onTankRemovedFromBattle);
this.battleEventSupport.addEventHandler(TankUnloadedEvent,this.onTankUnloaded);
this.battleEventSupport.activateHandlers();
}
[Obfuscation(rename="false")]
public function objectLoaded() : void {
var local1:RailgunCC = getInitParam();
putData(RailgunData,new RailgunData(local1.chargingTimeMsec,local1.weakeningCoeff));
}
[Obfuscation(rename="false")]
public function startCharging(param1:IGameObject) : void {
var local2:RemoteRailgunWeapon = this.weapons[param1];
if(local2 != null) {
local2.startCharging();
}
}
[Obfuscation(rename="false")]
public function fire(param1:IGameObject, param2:Vector3d, param3:Vector.<IGameObject>, param4:Vector.<Vector3d>) : void {
var local6:Vector.<Vector3> = null;
var local7:Vector.<Body> = null;
var local8:int = 0;
var local9:Body = null;
var local5:RemoteRailgunWeapon = this.weapons[param1];
if(local5 != null) {
local6 = convertHitPoints(param4);
if(local6 != null) {
local7 = convertTargets(param3,this.tanksOnField);
if(param3 != null) {
if(param3.length == local6.length) {
local8 = 0;
while(local8 < param3.length) {
local9 = local7[local8];
if(local9 != null && local9.tank != null) {
BattleUtils.localToGlobal(local9,local6[local8]);
}
local8++;
}
} else {
param3 = null;
local6 = null;
}
}
}
local5.fire(BattleUtils.getVector3OrNull(param2),local7,local6);
}
}
[Obfuscation(rename="false")]
public function fireDummy(param1:IGameObject) : void {
var local2:RemoteRailgunWeapon = this.weapons[param1];
if(local2 != null) {
local2.fireDummy();
}
}
public function createLocalWeapon(param1:IGameObject) : Weapon {
var local2:WeaponCommonData = getWeaponCommonData();
var local3:WeaponObject = getWeaponObject();
var local4:RailgunData = RailgunData(getData(RailgunData));
var local5:IRailgunEffects = getEffects();
var local6:TargetingSystem = new PenetratingTargetingSystem(param1,local3,local4.getWeakeningCoeff());
var local7:WeaponForces = new WeaponForces(local2.getImpactForce(),local2.getRecoilForce());
this.localWeapon = new RailgunWeapon(local6,new SimpleWeaponController(),local3,local7,local4.getWeakeningCoeff(),local4.getChargingTime(),local5,RailgunCallback(object.adapt(RailgunCallback)));
this.weapons[param1] = this.localWeapon;
return this.localWeapon;
}
public function createRemoteWeapon(param1:IGameObject) : Weapon {
var local2:WeaponCommonData = getWeaponCommonData();
var local3:RailgunData = RailgunData(getData(RailgunData));
var local4:IRailgunEffects = getEffects();
var local5:WeaponForces = new WeaponForces(local2.getImpactForce(),local2.getRecoilForce());
var local6:Weapon = new RemoteRailgunWeapon(local5,local3,local4);
this.weapons[param1] = local6;
return local6;
}
public function onStartCharging(param1:int) : void {
server.startChargingCommand(param1);
}
public function onShot(param1:int, param2:Vector3, param3:Vector.<Body>, param4:Vector.<Vector3>) : void {
var local5:Vector.<IGameObject> = null;
var local6:Vector.<Vector3d> = null;
var local7:Vector.<int> = null;
var local8:Vector.<Vector3d> = null;
var local10:Vector.<Vector3d> = null;
var local12:int = 0;
var local13:Body = null;
var local14:Vector3 = null;
var local15:Vector3 = null;
var local16:Tank = null;
var local9:int = int(param3.length);
if(local9 > 0) {
local5 = new Vector.<IGameObject>(local9);
local6 = new Vector.<Vector3d>(local9);
local7 = new Vector.<int>(local9);
local8 = new Vector.<Vector3d>(local9);
local10 = new Vector.<Vector3d>(local9);
local12 = 0;
while(local12 < local9) {
local13 = param3[local12];
local14 = param4[local12];
local15 = new Vector3();
local15.copy(local14);
BattleUtils.globalToLocal(local13,local14);
local16 = local13.tank;
local7[local12] = local16.incarnation;
local5[local12] = local16.getUser();
local6[local12] = BattleUtils.getVector3d(local14);
local8[local12] = BattleUtils.getVector3d(local13.state.position);
local10[local12] = BattleUtils.getVector3d(local15);
local12++;
}
}
var local11:Vector3d = BattleUtils.getVector3dOrNull(param2);
this.battleEventSupport.dispatchEvent(StateCorrectionEvent.MANDATORY_UPDATE);
server.fireCommand(param1,local11,local5,local6,local7,local8,local10);
}
public function onShotDummy(param1:int) : void {
server.fireDummyCommand(param1);
}
private function onTankAddedToBattle(param1:TankAddedToBattleEvent) : void {
this.tanksOnField[param1.tank.getUser()] = param1.tank;
}
private function onTankRemovedFromBattle(param1:TankRemovedFromBattleEvent) : void {
delete this.tanksOnField[param1.tank.getUser()];
}
private function onTankUnloaded(param1:TankUnloadedEvent) : void {
delete this.tanksOnField[param1.tank.getUser()];
}
public function immediateReload() : void {
this.localWeapon.fullyRecharge();
}
public function reconfigureWeapon(param1:int) : void {
if(this.isLocalWeapon()) {
this.localWeapon.updateChargingTime(param1);
}
RailgunData(getData(RailgunData)).setChargingTime(param1);
}
public function onStun(param1:Tank, param2:Boolean) : void {
if(param2) {
this.localWeapon.stun();
}
}
public function onCalm(param1:Tank, param2:Boolean, param3:int) : void {
if(param2) {
this.localWeapon.calm(param3);
}
}
public function weaponReloadTimeChanged(param1:int, param2:int) : void {
var local3:Tank = null;
if(this.isLocalWeapon()) {
local3 = IWeaponCommonModel(object.adapt(IWeaponCommonModel)).getTank();
Weapon(this.weapons[local3.user]).weaponReloadTimeChanged(param1,param2);
}
}
public function weaponBuffStateChanged(param1:IGameObject, param2:Boolean, param3:Number) : void {
var local4:Weapon = this.weapons[param1];
if(local4 != null) {
local4.updateRecoilForce(param3);
if(local4 == this.localWeapon && !param2) {
local4.fullyRecharge();
}
}
}
private function isLocalWeapon() : Boolean {
var local1:Tank = IWeaponCommonModel(object.adapt(IWeaponCommonModel)).getTank();
return ITankModel(local1.user.adapt(ITankModel)).isLocal();
}
}
}
|
package alternativa.gfx.agal {
public class VertexShader extends Shader {
public static const va0:CommonRegister = new CommonRegister(0,0);
public static const va1:CommonRegister = new CommonRegister(1,0);
public static const va2:CommonRegister = new CommonRegister(2,0);
public static const va3:CommonRegister = new CommonRegister(3,0);
public static const va4:CommonRegister = new CommonRegister(4,0);
public static const va5:CommonRegister = new CommonRegister(5,0);
public static const va6:CommonRegister = new CommonRegister(6,0);
public static const va7:CommonRegister = new CommonRegister(7,0);
public static const vt0:CommonRegister = new CommonRegister(0,2);
public static const vt1:CommonRegister = new CommonRegister(1,2);
public static const vt2:CommonRegister = new CommonRegister(2,2);
public static const vt3:CommonRegister = new CommonRegister(3,2);
public static const vt4:CommonRegister = new CommonRegister(4,2);
public static const vt5:CommonRegister = new CommonRegister(5,2);
public static const vt6:CommonRegister = new CommonRegister(6,2);
public static const vt7:CommonRegister = new CommonRegister(7,2);
public static const vc:Vector.<CommonRegister> = getConsts();
public static const op:CommonRegister = new CommonRegister(0,3);
public function VertexShader() {
super();
data.writeByte(0);
}
private static function getConsts() : Vector.<CommonRegister> {
var local1:Vector.<CommonRegister> = new Vector.<CommonRegister>();
var local2:int = 0;
while(local2 < 127) {
local1[local2] = new CommonRegister(local2,1);
local2++;
}
return local1;
}
}
}
|
package alternativa.tanks.models.battle.battlefield {
import alternativa.tanks.battle.BattleService;
import alternativa.tanks.camera.controllers.spectator.KeyboardHandler;
import alternativa.tanks.services.battleinput.BattleInputService;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
public class SpectatorFogToggleSupport implements KeyboardHandler {
[Inject]
public static var battleInputService:BattleInputService;
[Inject]
public static var battleService:BattleService;
private static const FOG_TOGGLE_KEY:uint = Keyboard.F8;
public function SpectatorFogToggleSupport() {
super();
}
public function handleKeyDown(param1:KeyboardEvent) : void {
if(param1.keyCode == FOG_TOGGLE_KEY && !battleInputService.isInputLocked()) {
battleService.getBattleScene3D().toggleFog();
}
}
public function handleKeyUp(param1:KeyboardEvent) : void {
}
}
}
|
package alternativa.tanks.models.weapon.shared.shot {
[ModelInterface]
public interface IShotModel {
function getReloadMS() : int;
}
}
|
package _codec.projects.tanks.client.panel.model.coin {
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.coin.CoinInfoCC;
public class CodecCoinInfoCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_coins:ICodec;
private var codec_enabled:ICodec;
public function CodecCoinInfoCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_coins = param1.getCodec(new TypeCodecInfo(int,false));
this.codec_enabled = param1.getCodec(new TypeCodecInfo(Boolean,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:CoinInfoCC = new CoinInfoCC();
local2.coins = this.codec_coins.decode(param1) as int;
local2.enabled = this.codec_enabled.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:CoinInfoCC = CoinInfoCC(param2);
this.codec_coins.encode(param1,local3.coins);
this.codec_enabled.encode(param1,local3.enabled);
}
}
}
|
package alternativa.tanks.models.weapon.smoky {
import alternativa.math.Vector3;
import alternativa.physics.Body;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class SmokyCallbackAdapt implements SmokyCallback {
private var object:IGameObject;
private var impl:SmokyCallback;
public function SmokyCallbackAdapt(param1:IGameObject, param2:SmokyCallback) {
super();
this.object = param1;
this.impl = param2;
}
public function onShot(param1:int) : void {
var time:int = param1;
try {
Model.object = this.object;
this.impl.onShot(time);
}
finally {
Model.popObject();
}
}
public function onShotStatic(param1:int, param2:Vector3) : void {
var time:int = param1;
var hitPoint:Vector3 = param2;
try {
Model.object = this.object;
this.impl.onShotStatic(time,hitPoint);
}
finally {
Model.popObject();
}
}
public function onShotTarget(param1:int, param2:Vector3, param3:Body) : void {
var time:int = param1;
var hitPoint:Vector3 = param2;
var target:Body = param3;
try {
Model.object = this.object;
this.impl.onShotTarget(time,hitPoint,target);
}
finally {
Model.popObject();
}
}
}
}
|
package alternativa.tanks.model.panel.payment {
import alternativa.osgi.service.launcherparams.ILauncherParams;
import alternativa.tanks.gui.panel.ButtonBar;
import alternativa.tanks.service.panel.IPanelView;
import alternativa.tanks.service.payment.IPaymentService;
import platform.client.fp10.core.model.ObjectLoadListener;
import platform.client.fp10.core.model.ObjectLoadPostListener;
import projects.tanks.client.panel.model.payment.panel.IPaymentButtonModelBase;
import projects.tanks.client.panel.model.payment.panel.PaymentButtonModelBase;
[ModelInfo]
public class PaymentButtonModel extends PaymentButtonModelBase implements IPaymentButtonModelBase, ObjectLoadListener, ObjectLoadPostListener {
[Inject]
public static var panelView:IPanelView;
[Inject]
public static var paymentService:IPaymentService;
[Inject]
public static var launchParams:ILauncherParams;
public function PaymentButtonModel() {
super();
}
public function objectLoaded() : void {
paymentService.initPaymentMode(getInitParam());
}
public function objectLoadedPost() : void {
var local1:ButtonBar = panelView.getPanel().buttonBar;
if(!paymentService.isEnabled() && launchParams.getParameter("shopButtonEnabled","false") != "true") {
local1.hidePaymentButton();
}
}
}
}
|
package alternativa.engine3d.loaders.collada {
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.core.Vertex;
import alternativa.engine3d.objects.Mesh;
use namespace alternativa3d;
use namespace collada;
public class DaeVertices extends DaeElement {
private var positions:DaeSource;
public function DaeVertices(param1:XML, param2:DaeDocument) {
super(param1,param2);
}
override protected function parseImplementation() : Boolean {
var inputXML:XML = null;
inputXML = data.input.(@semantic == "POSITION")[0];
if(inputXML != null) {
this.positions = new DaeInput(inputXML,document).prepareSource(3);
if(this.positions != null) {
return true;
}
}
return false;
}
public function fillInMesh(param1:Mesh) : Vector.<Vertex> {
var local6:int = 0;
var local7:int = 0;
var local8:Vertex = null;
var local2:int = this.positions.stride;
var local3:Vector.<Number> = this.positions.numbers;
var local4:int = this.positions.numbers.length / local2;
var local5:Vector.<Vertex> = new Vector.<Vertex>(local4);
local6 = 0;
while(local6 < local4) {
local7 = local2 * local6;
local8 = new Vertex();
local8.alternativa3d::next = param1.alternativa3d::vertexList;
param1.alternativa3d::vertexList = local8;
local8.x = local3[local7];
local8.y = local3[int(local7 + 1)];
local8.z = local3[int(local7 + 2)];
local8.alternativa3d::index = -1;
local5[local6] = local8;
local6++;
}
return local5;
}
}
}
|
package alternativa.tanks.models.weapon.streamweapon {
[ModelInterface]
public interface IStreamWeaponModel {
function getStreamWeaponData() : StreamWeaponData;
}
}
|
package projects.tanks.clients.fp10.libraries.tanksservices.service.helper {
import alternativa.osgi.OSGi;
import alternativa.osgi.service.display.IDisplay;
import flash.display.DisplayObjectContainer;
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.net.SharedObject;
import flash.utils.Dictionary;
import projects.tanks.clients.fp10.libraries.tanksservices.service.storage.IStorageService;
import projects.tanks.clients.fp10.libraries.tanksservices.utils.AlertUtils;
import projects.tanks.clients.fp10.libraries.tanksservices.utils.KeyUpListenerPriority;
public class HelpService implements IHelpService {
private var storage:SharedObject;
private var stage:Stage;
private var helpLayer:DisplayObjectContainer;
private var helpContainer:Sprite;
private var helpGroups:Dictionary;
private var mainGroupObjects:Array;
private var advancedUser:Boolean;
private var timers:Array;
private var listenerAdded:Boolean;
private var currentlyVisibleHelpers:Dictionary;
private var storedState:Dictionary = new Dictionary();
private var addedDuringLock:Vector.<ShowedHelperInfo> = new Vector.<ShowedHelperInfo>();
private var hidedHelpers:Vector.<Object>;
private var locked:Boolean;
private const showPeriod:int = 86400000;
private const showCount:int = 5;
public function HelpService() {
super();
var local1:OSGi = OSGi.getInstance();
var local2:IDisplay = IDisplay(local1.getService(IDisplay));
this.stage = local2.stage;
this.helpLayer = local2.noticesLayer;
this.helpContainer = new Sprite();
this.helpGroups = new Dictionary();
this.mainGroupObjects = new Array();
this.timers = new Array();
this.storage = IStorageService(local1.getService(IStorageService)).getStorage();
if(!this.storage.data.helperShowNum) {
this.storage.data.helperShowNum = new Vector.<Object>();
}
if(this.storage.data.hidedHelpers as Vector.<Object> == null) {
this.storage.data.hidedHelpers = new Vector.<Object>();
}
this.hidedHelpers = this.storage.data.hidedHelpers as Vector.<Object>;
this.advancedUser = int(this.storage.data.userRank) >= 6;
this.currentlyVisibleHelpers = new Dictionary();
this.stage.addEventListener(Event.RESIZE,this.onStageResize);
}
public function registerHelper(param1:String, param2:int, param3:Helper, param4:Boolean) : void {
var local9:Object = null;
var local5:Dictionary = this.helpGroups[param1];
if(local5 == null) {
local5 = new Dictionary();
this.helpGroups[param1] = local5;
}
local5[param2] = param3;
if(param4) {
this.mainGroupObjects.push(param3);
}
var local6:Vector.<Object> = this.storage.data.helperShowNum != null && this.storage.data.helperShowNum is Vector.<Object> ? this.storage.data.helperShowNum as Vector.<Object> : new Vector.<Object>();
var local7:int = -1;
var local8:int = 0;
while(local8 < local6.length) {
if(Boolean(local6[local8].hasOwnProperty("groupKey")) && local6[local8].groupKey == param1) {
local7 = local8;
}
local8++;
}
if(local7 == -1) {
local9 = new Object();
local9.groupKey = param1;
local9.helper = new Array();
local6.push(local9);
local7 = local6.length - 1;
}
if(local6[local7].helper == null) {
local6[local7].helper = new Array();
}
if(local6[local7].helper[param2] == null) {
local6[local7].helper[param2] = param3.showNum;
} else {
param3.showNum = local6[local7].helper[param2];
}
this.storage.data.helperShowNum = local6;
param3.id = param2;
param3.groupKey = param1;
}
public function unregisterHelper(param1:String, param2:int) : void {
var local3:Dictionary = this.helpGroups[param1];
if(local3 == null) {
return;
}
var local4:Helper = local3[param2];
if(local4 == null) {
return;
}
this.doHideHelper(local4);
delete local3[param2];
var local5:int = int(this.mainGroupObjects.indexOf(local4));
if(local5 >= 0) {
this.mainGroupObjects.splice(local5,1);
}
}
public function showHelperIfAble(param1:String, param2:int, param3:Boolean = false) : void {
if(this.locked) {
this.addedDuringLock.push(new ShowedHelperInfo(param1,param2,param3));
} else {
this.showHelper(param1,param2,param3);
}
}
public function showHelper(param1:String, param2:int, param3:Boolean = false) : void {
var local5:Vector.<Object> = null;
var local6:int = 0;
var local7:int = 0;
var local8:Object = null;
var local9:HelperTimer = null;
if(this.advancedUser || this.helperHiddenManually(param1,param2)) {
return;
}
var local4:Helper = this.getHelper(param1,param2);
if(local4 == null) {
return;
}
if(!this.helpLayer.contains(this.helpContainer)) {
this.helpLayer.addChild(this.helpContainer);
}
if(param3 || local4.showLimit == -1 || local4.showNum < local4.showLimit) {
if(!this.helpContainer.contains(local4)) {
++local4.showNum;
this.currentlyVisibleHelpers[local4] = new ShowedHelperInfo(param1,param2,param3);
local5 = this.storage.data.helperShowNum != null && this.storage.data.helperShowNum is Vector.<Object> ? this.storage.data.helperShowNum as Vector.<Object> : new Vector.<Object>();
local6 = -1;
local7 = 0;
while(local7 < local5.length) {
if(Boolean(local5[local7].hasOwnProperty("groupKey")) && local5[local7].groupKey == param1) {
local6 = local7;
}
local7++;
}
if(local6 == -1) {
local8 = new Object();
local8.groupKey = param1;
local8.helper = new Array();
local8.helper[param2] = local4.showNum;
local5.push(local8);
} else {
local5[local6].helper[param2] = local4.showNum;
}
this.storage.data.helperShowNum = local5;
this.helpContainer.addChild(local4);
local4.draw(local4.size);
local4.align(this.stage.stageWidth,this.stage.stageHeight);
local4.addEventListener(MouseEvent.MOUSE_DOWN,this.onHelperClick);
if(!param3) {
local9 = new HelperTimer(local4.showDuration,1);
local9.helper = local4;
local4.timer = local9;
local9.addEventListener(TimerEvent.TIMER_COMPLETE,this.onHelperTimer);
this.timers.push(local9);
local9.start();
}
}
}
}
private function helperHiddenManually(param1:String, param2:int) : Boolean {
var local4:Object = null;
var local3:Date = new Date();
for each(local4 in this.hidedHelpers) {
if(local4.groupKey == param1 && local4.helperId == param2) {
return local3.time - local4.date.time < this.showPeriod || local4.count >= this.showCount;
}
}
return false;
}
public function hideAllHelpers() : void {
var local1:Helper = null;
if(this.helpContainer != null) {
while(this.helpContainer.numChildren != 0) {
local1 = this.helpContainer.getChildAt(0) as Helper;
this.hideHelper(local1.groupKey,local1.id);
}
if(this.helpContainer.numChildren == 0 && this.helpLayer.contains(this.helpContainer)) {
this.helpLayer.removeChild(this.helpContainer);
}
}
}
public function hideHelper(param1:String, param2:int) : void {
if(this.currentlyVisibleHelpers[this.getHelper(param1,param2)] != null) {
delete this.currentlyVisibleHelpers[this.getHelper(param1,param2)];
}
this.doHideHelper(this.getHelper(param1,param2));
this.checkContainerEmptiness();
}
private function checkContainerEmptiness() : void {
if(this.helpContainer.numChildren == 0 && this.helpLayer.contains(this.helpContainer)) {
this.helpLayer.removeChild(this.helpContainer);
}
}
public function showHelp() : void {
var local2:Helper = null;
var local3:int = 0;
if(!this.helpLayer.contains(this.helpContainer)) {
this.helpLayer.addChild(this.helpContainer);
}
var local1:int = 0;
while(local1 < this.mainGroupObjects.length) {
local2 = this.mainGroupObjects[local1] as Helper;
if(!this.helpContainer.contains(local2)) {
this.helpContainer.addChild(local2);
local2.draw(local2.size);
local2.align(this.stage.stageWidth,this.stage.stageHeight);
} else {
local3 = int(this.timers.indexOf(local2.timer));
if(local3 != -1) {
HelperTimer(this.timers[local3]).stop();
this.timers.splice(local3,1);
}
}
this.currentlyVisibleHelpers[local2] = new ShowedHelperInfo(local2.groupKey,local2.id,true);
local1++;
}
if(!this.listenerAdded) {
this.listenerAdded = true;
this.stage.addEventListener(MouseEvent.CLICK,this.onStageMouseClick,true);
this.stage.addEventListener(KeyboardEvent.KEY_UP,this.onKeyUp,false,KeyUpListenerPriority.HELP);
}
}
private function onKeyUp(param1:KeyboardEvent) : void {
if(AlertUtils.isCancelKey(param1.keyCode)) {
param1.stopImmediatePropagation();
this.hideHelp();
}
}
public function hideHelp() : void {
var local2:Helper = null;
var local3:int = 0;
var local1:int = 0;
while(local1 < this.mainGroupObjects.length) {
local2 = this.mainGroupObjects[local1];
local3 = int(this.timers.indexOf(local2.timer));
if(local3 != -1) {
(this.timers[local3] as HelperTimer).stop();
this.timers.splice(local3,1);
}
if(this.helpContainer.contains(local2)) {
this.helpContainer.removeChild(local2);
}
if(this.currentlyVisibleHelpers[local2] != null) {
delete this.currentlyVisibleHelpers[local2];
}
local1++;
}
this.checkContainerEmptiness();
if(this.listenerAdded) {
this.listenerAdded = false;
this.stage.removeEventListener(MouseEvent.CLICK,this.onStageMouseClick,true);
this.stage.removeEventListener(KeyboardEvent.KEY_UP,this.onKeyUp);
}
}
public function pushState() : void {
var local1:Object = null;
this.storedState = new Dictionary();
for(local1 in this.currentlyVisibleHelpers) {
this.storedState[local1] = this.currentlyVisibleHelpers[local1];
}
}
public function popState() : void {
var local1:Object = null;
for(local1 in this.storedState) {
this.showHelper(this.storedState[local1].groupKey,this.storedState[local1].helperId,this.storedState[local1].force);
}
this.storedState = new Dictionary();
}
private function onStageMouseClick(param1:MouseEvent) : void {
this.hideHelp();
param1.stopPropagation();
}
private function onHelperTimer(param1:TimerEvent) : void {
var local2:HelperTimer = param1.target as HelperTimer;
var local3:Helper = local2.helper;
this.hideHelper(local3.groupKey,local3.id);
}
private function onHelperClick(param1:MouseEvent) : void {
var local2:Helper = null;
if(param1.target is Helper) {
local2 = param1.target as Helper;
this.hideHelper(local2.groupKey,local2.id);
this.addHidedHelper(local2);
param1.stopPropagation();
}
}
private function addHidedHelper(param1:Helper) : void {
var local4:Object = null;
var local2:Date = new Date();
var local3:Boolean = false;
for each(local4 in this.hidedHelpers) {
if(local4.groupKey == param1.groupKey && local4.helperId == param1.id) {
local4.date = local2;
++local4.count;
local3 = true;
}
}
if(!local3) {
this.hidedHelpers.push(new HidedHelperInfo(param1.groupKey,param1.id,local2,0));
}
}
private function onStageResize(param1:Event) : void {
var local2:int = 0;
var local3:Helper = null;
if(this.helpLayer.contains(this.helpContainer)) {
local2 = 0;
while(local2 < this.helpContainer.numChildren) {
local3 = this.helpContainer.getChildAt(local2) as Helper;
if(local3 != null) {
local3.align(this.stage.stageWidth,this.stage.stageHeight);
}
local2++;
}
}
}
private function getHelper(param1:String, param2:int) : Helper {
var local3:Dictionary = this.helpGroups[param1];
if(local3 == null) {
return null;
}
return local3[param2];
}
private function doHideHelper(param1:Helper) : void {
var local3:int = 0;
if(param1 == null) {
return;
}
if(this.helpContainer.contains(param1)) {
this.helpContainer.removeChild(param1);
}
param1.removeEventListener(MouseEvent.MOUSE_DOWN,this.onHelperClick);
var local2:HelperTimer = param1.timer;
if(local2 != null) {
local2.stop();
local3 = int(this.timers.indexOf(local2));
if(local3 != -1) {
this.timers.splice(local3,1);
}
}
}
public function lock() : void {
this.locked = true;
}
public function unlock() : void {
var local1:ShowedHelperInfo = null;
this.locked = false;
for each(local1 in this.addedDuringLock) {
this.showHelper(local1.groupKey,local1.helperId,local1.force);
}
this.addedDuringLock = new Vector.<ShowedHelperInfo>();
}
public function manuallyShutDownHelper(param1:Helper) : void {
this.hideHelper(param1.groupKey,param1.id);
this.addHidedHelper(param1);
}
}
}
class ShowedHelperInfo {
public var groupKey:String;
public var helperId:int;
public var force:Boolean = false;
public function ShowedHelperInfo(param1:String, param2:int, param3:Boolean) {
super();
this.groupKey = param1;
this.helperId = param2;
this.force = param3;
}
}
class HidedHelperInfo {
public var groupKey:String;
public var helperId:int;
public var date:Date;
public var count:int;
public function HidedHelperInfo(param1:String, param2:int, param3:Date, param4:int) {
super();
this.groupKey = param1;
this.helperId = param2;
this.date = param3;
this.count = param4;
}
public function toString() : String {
return this.date.toString() + ", " + this.count.toString();
}
}
|
package _codec.projects.tanks.client.battleservice.model.statistics {
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 alternativa.types.Long;
import alternativa.types.Short;
import projects.tanks.client.battleservice.model.statistics.UserInfo;
import projects.tanks.client.users.services.chatmoderator.ChatModeratorLevel;
public class CodecUserInfo implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_chatModeratorLevel:ICodec;
private var codec_deaths:ICodec;
private var codec_hasPremium:ICodec;
private var codec_kills:ICodec;
private var codec_rank:ICodec;
private var codec_score:ICodec;
private var codec_uid:ICodec;
private var codec_user:ICodec;
public function CodecUserInfo() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_chatModeratorLevel = param1.getCodec(new EnumCodecInfo(ChatModeratorLevel,false));
this.codec_deaths = param1.getCodec(new TypeCodecInfo(Short,false));
this.codec_hasPremium = param1.getCodec(new TypeCodecInfo(Boolean,false));
this.codec_kills = param1.getCodec(new TypeCodecInfo(Short,false));
this.codec_rank = param1.getCodec(new TypeCodecInfo(Byte,false));
this.codec_score = param1.getCodec(new TypeCodecInfo(int,false));
this.codec_uid = param1.getCodec(new TypeCodecInfo(String,false));
this.codec_user = param1.getCodec(new TypeCodecInfo(Long,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:UserInfo = new UserInfo();
local2.chatModeratorLevel = this.codec_chatModeratorLevel.decode(param1) as ChatModeratorLevel;
local2.deaths = this.codec_deaths.decode(param1) as int;
local2.hasPremium = this.codec_hasPremium.decode(param1) as Boolean;
local2.kills = this.codec_kills.decode(param1) as int;
local2.rank = this.codec_rank.decode(param1) as int;
local2.score = this.codec_score.decode(param1) as int;
local2.uid = this.codec_uid.decode(param1) as String;
local2.user = this.codec_user.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:UserInfo = UserInfo(param2);
this.codec_chatModeratorLevel.encode(param1,local3.chatModeratorLevel);
this.codec_deaths.encode(param1,local3.deaths);
this.codec_hasPremium.encode(param1,local3.hasPremium);
this.codec_kills.encode(param1,local3.kills);
this.codec_rank.encode(param1,local3.rank);
this.codec_score.encode(param1,local3.score);
this.codec_uid.encode(param1,local3.uid);
this.codec_user.encode(param1,local3.user);
}
}
}
|
package assets.resultwindow {
import flash.display.BitmapData;
[Embed(source="/_assets/assets.resultwindow.items_mini_LEFT.png")]
public dynamic class items_mini_LEFT extends BitmapData {
public function items_mini_LEFT(param1:int = 20, param2:int = 40) {
super(param1,param2);
}
}
}
|
package alternativa.tanks.models.weapons.discrete {
import alternativa.tanks.models.weapon.WeaponObject;
import platform.client.fp10.core.type.IGameObject;
public class DiscreteWeaponObject extends WeaponObject {
public function DiscreteWeaponObject(param1:IGameObject) {
super(param1);
}
public function discrete() : DiscreteWeapon {
return DiscreteWeapon(super.object.adapt(DiscreteWeapon));
}
}
}
|
package forms.userlabel {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/forms.userlabel.ChatUserLabel_bronzeBattleStatusIconClass.png")]
public class ChatUserLabel_bronzeBattleStatusIconClass extends BitmapAsset {
public function ChatUserLabel_bronzeBattleStatusIconClass() {
super();
}
}
}
|
package alternativa.tanks.models.tank.gearscore {
[ModelInterface]
public interface GearScoreInfo {
function getScore() : int;
}
}
|
package projects.tanks.client.battleselect.model.matchmaking.group.notify {
import alternativa.types.Long;
import projects.tanks.client.commons.types.ItemCategoryEnum;
public class MountItemsUserData {
private var _id:Long;
private var _itemCategory:ItemCategoryEnum;
private var _modification:int;
private var _name:String;
private var _upgradeLevel:int;
public function MountItemsUserData(param1:Long = null, param2:ItemCategoryEnum = null, param3:int = 0, param4:String = null, param5:int = 0) {
super();
this._id = param1;
this._itemCategory = param2;
this._modification = param3;
this._name = param4;
this._upgradeLevel = param5;
}
public function get id() : Long {
return this._id;
}
public function set id(param1:Long) : void {
this._id = param1;
}
public function get itemCategory() : ItemCategoryEnum {
return this._itemCategory;
}
public function set itemCategory(param1:ItemCategoryEnum) : void {
this._itemCategory = param1;
}
public function get modification() : int {
return this._modification;
}
public function set modification(param1:int) : void {
this._modification = param1;
}
public function get name() : String {
return this._name;
}
public function set name(param1:String) : void {
this._name = param1;
}
public function get upgradeLevel() : int {
return this._upgradeLevel;
}
public function set upgradeLevel(param1:int) : void {
this._upgradeLevel = param1;
}
public function toString() : String {
var local1:String = "MountItemsUserData [";
local1 += "id = " + this.id + " ";
local1 += "itemCategory = " + this.itemCategory + " ";
local1 += "modification = " + this.modification + " ";
local1 += "name = " + this.name + " ";
local1 += "upgradeLevel = " + this.upgradeLevel + " ";
return local1 + "]";
}
}
}
|
package forms.friends.list.renderer.background
{
import controls.cellrenderer.ButtonState;
import flash.display.Sprite;
import forms.friends.list.AcceptedList;
import forms.friends.list.renderer.HeaderAcceptedList;
public class RendererBackGroundAcceptedList extends Sprite
{
protected var tabs:Vector.<Number>;
protected var _width:int = 100;
public function RendererBackGroundAcceptedList(param1:Boolean, param2:Boolean = false)
{
var _loc3_:ButtonState = null;
this.tabs = new Vector.<Number>();
super();
var _loc4_:int = HeaderAcceptedList.HEADERS.length;
var _loc5_:int = 0;
while(_loc5_ < _loc4_)
{
if(param1)
{
if(param2)
{
_loc3_ = new FriendCellSelected();
}
else
{
_loc3_ = new FriendCellNormal();
}
}
else if(param2)
{
_loc3_ = new UserOfflineCellSelected();
}
else
{
_loc3_ = new UserOfflineCellNormal();
}
addChild(_loc3_);
_loc5_++;
}
this.resize();
}
protected function resize() : void
{
var _loc1_:ButtonState = null;
if(this.isScroll())
{
this.tabs = Vector.<Number>([0,this._width - 224,this._width - 1]);
}
else
{
this.tabs = Vector.<Number>([0,this._width - 233,this._width - 1]);
}
var _loc2_:int = HeaderAcceptedList.HEADERS.length;
var _loc3_:int = 0;
while(_loc3_ < _loc2_)
{
_loc1_ = getChildAt(_loc3_) as ButtonState;
_loc1_.width = this.tabs[_loc3_ + 1] - this.tabs[_loc3_] - 2;
_loc1_.height = 18;
_loc1_.x = this.tabs[_loc3_];
_loc3_++;
}
graphics.clear();
graphics.beginFill(16711680,0);
graphics.drawRect(0,0,this._width - 1,18);
graphics.endFill();
}
protected function isScroll() : Boolean
{
return AcceptedList.SCROLL_ON;
}
override public function set width(param1:Number) : void
{
this._width = Math.floor(param1);
this.resize();
}
}
}
|
package alternativa.tanks.models.battle.battlefield.map {
import alternativa.engine3d.containers.KDContainer;
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.core.Object3DContainer;
import alternativa.engine3d.objects.BSP;
import alternativa.engine3d.objects.Mesh;
import alternativa.engine3d.objects.Sprite3D;
import alternativa.math.Vector3;
import alternativa.osgi.service.command.CommandService;
import alternativa.osgi.service.command.FormattedOutput;
import alternativa.osgi.service.console.variables.ConsoleVarInt;
import alternativa.physics.collision.CollisionShape;
import alternativa.physics.collision.primitives.CollisionBox;
import alternativa.physics.collision.primitives.CollisionRect;
import alternativa.physics.collision.primitives.CollisionTriangle;
import alternativa.physics.collision.types.AABB;
import alternativa.proplib.PropLibRegistry;
import alternativa.tanks.battle.BattleRunner;
import alternativa.tanks.battle.BattleService;
import alternativa.tanks.battle.hidablegraphicobjects.HidableObject3DWrapper;
import alternativa.tanks.battle.scene3d.BattleScene3D;
import alternativa.tanks.sfx.StaticObject3DPositionProvider;
import alternativa.tanks.sfx.christmas.ChristmasTreeToyEffect;
import alternativa.tanks.utils.DataValidator;
import alternativa.tanks.utils.StaticCollisionBoxValidator;
import alternativa.tanks.utils.StaticCollisionTriangleValidator;
import alternativa.tanks.utils.StaticCollisoinRectValidator;
import alternativa.tanks.utils.objectpool.ObjectPool;
import alternativa.utils.TextureMaterialRegistry;
import flash.display.BitmapData;
import flash.events.Event;
import flash.utils.clearTimeout;
import flash.utils.setTimeout;
import platform.client.fp10.core.type.AutoClosable;
public class MapBuilder implements AutoClosable {
[Inject]
public static var dataValidator:DataValidator;
[Inject]
public static var battleService:BattleService;
[Inject]
public static var commandService:CommandService;
private static const conMapDelay:ConsoleVarInt = new ConsoleVarInt("map_delay",0,0,600);
private static const KDTREE_THRESHOLD:Number = 0.1;
private static const TEXTURE_BUILDER_BATCH_SIZE:int = 20;
private var materialRegistry:TextureMaterialRegistry;
private var propLibRegistry:PropLibRegistry;
private var texturesBuilder:MapTexturesBuilder;
private var mapContainer:KDContainer;
private var buildCompleteCallback:Function;
private var mapBounds:AABB;
private var textures:Vector.<BitmapData>;
private var mapGeometryParser:MapGeometryParser;
private var completeTimeoutId:uint;
private var texturesReady:Boolean;
private var isComplete:Boolean;
public function MapBuilder(param1:TextureMaterialRegistry, param2:PropLibRegistry) {
super();
this.materialRegistry = param1;
this.propLibRegistry = param2;
}
private function forceComplete(param1:FormattedOutput) : void {
}
public function getMapContainer() : Object3DContainer {
return this.mapContainer;
}
public function build(param1:XML, param2:Function) : void {
this.buildCompleteCallback = param2;
this.initPhysicsGeometry(param1);
this.parseMapGeometry(param1);
this.buildTextures();
}
private function initPhysicsGeometry(param1:XML) : void {
var local2:Vector.<CollisionShape> = CollisionGeometryParser.parse(param1);
var local3:BattleRunner = battleService.getBattleRunner();
local3.initStaticGeometry(local2);
this.addMapValidators(local2);
}
private function addMapValidators(param1:Vector.<CollisionShape>) : void {
var local2:CollisionShape = null;
for each(local2 in param1) {
if(local2 is CollisionBox) {
dataValidator.addValidator(new StaticCollisionBoxValidator(CollisionBox(local2)));
} else if(local2 is CollisionRect) {
dataValidator.addValidator(new StaticCollisoinRectValidator(CollisionRect(local2)));
} else if(local2 is CollisionTriangle) {
dataValidator.addValidator(new StaticCollisionTriangleValidator(CollisionTriangle(local2)));
}
}
}
private function parseMapGeometry(param1:XML) : void {
this.mapGeometryParser = new MapGeometryParser(this.propLibRegistry);
this.mapGeometryParser.parse(param1);
this.mapBounds = this.mapGeometryParser.getMapBounds();
}
private function buildTextures() : void {
this.texturesBuilder = new MapTexturesBuilder(this.materialRegistry,TEXTURE_BUILDER_BATCH_SIZE);
this.texturesBuilder.addEventListener(Event.COMPLETE,this.onTexturesReady);
this.texturesBuilder.run(this.mapGeometryParser.getTexturedPropsCollections());
}
private function onTexturesReady(param1:Event) : void {
var local2:int = 0;
this.texturesReady = true;
this.texturesBuilder.removeEventListener(Event.COMPLETE,this.onTexturesReady);
this.completeTimeoutId = setTimeout(this.complete,local2);
}
private function complete() : void {
this.isComplete = true;
clearTimeout(this.completeTimeoutId);
this.textures = this.texturesBuilder.getTextures();
this.setupChristmasTree();
this.createMap();
this.setupBillboards();
this.setupChristmasTreeToys();
this.mapGeometryParser.clear();
this.mapGeometryParser = null;
this.texturesBuilder = null;
this.materialRegistry = null;
this.propLibRegistry = null;
this.buildCompleteCallback();
}
private function setupChristmasTree() : void {
if(this.mapGeometryParser.getChristmasTree() == null) {
return;
}
(this.mapGeometryParser.getChristmasTree() as BSP).faces[0].material.alphaTestThreshold = 0.5;
}
private function setupChristmasTreeToys() : void {
var local1:int = 0;
var local2:Object3D = null;
var local6:Vector3 = null;
var local7:Vector3 = null;
var local8:StaticObject3DPositionProvider = null;
var local9:ChristmasTreeToyEffect = null;
if(this.mapGeometryParser.getChristmasTree() == null) {
return;
}
var local3:Vector.<Object3D> = this.mapGeometryParser.getChristmasTreeToys();
var local4:int = int(local3.length);
var local5:ObjectPool = battleService.getObjectPool();
local6 = new Vector3();
local1 = 0;
while(local1 < local4) {
local2 = local3[local1];
local6.x += local2.x;
local6.y += local2.y;
local6.z += local2.z;
local1++;
}
local6.x /= local4;
local6.y /= local4;
local6.z /= local4;
local7 = new Vector3();
local1 = 0;
while(local1 < local4) {
local2 = local3[local1];
local7.x = local2.x;
local7.y = local2.y;
local7.z = local2.z;
local8 = StaticObject3DPositionProvider(local5.getObject(StaticObject3DPositionProvider));
local8.init(local7,150);
local9 = ChristmasTreeToyEffect(local5.getObject(ChristmasTreeToyEffect));
local9.init(local2 as Sprite3D,local8,local6);
battleService.getBattleScene3D().addGraphicEffect(local9);
local1++;
}
}
private function createMap() : void {
var local3:Object3D = null;
this.mapContainer = new KDContainer();
this.mapContainer.threshold = KDTREE_THRESHOLD;
this.mapContainer.ignoreChildrenInCollider = true;
var local1:Vector.<Object3D> = this.mapGeometryParser.getObjects();
local1.push(new HelperMesh());
this.mapContainer.createTree(local1,this.mapGeometryParser.getOccluders());
var local2:BattleScene3D = battleService.getBattleScene3D();
for each(local3 in this.mapGeometryParser.getSprites()) {
this.mapContainer.addChild(local3);
local2.hidableGraphicObjects.add(new HidableObject3DWrapper(local3));
}
this.mapContainer.calculateBounds();
local2.setMapContainer(this.mapContainer);
}
private function setupBillboards() : void {
var local3:Mesh = null;
var local1:Vector.<Mesh> = this.mapGeometryParser.getBillboards();
var local2:BattleScene3D = battleService.getBattleScene3D();
for each(local3 in local1) {
local2.addBillboard(local3);
}
}
public function getMapBounds() : AABB {
return this.mapBounds;
}
[Obfuscation(rename="false")]
public function close() : void {
clearTimeout(this.completeTimeoutId);
if(this.mapContainer != null) {
this.mapContainer.destroyTree();
this.mapContainer = null;
}
if(this.texturesBuilder != null) {
this.texturesBuilder.removeEventListener(Event.COMPLETE,this.onTexturesReady);
this.texturesBuilder.destroy();
this.texturesBuilder = null;
}
if(this.mapGeometryParser != null) {
this.mapGeometryParser.clear();
this.mapGeometryParser = null;
}
this.buildCompleteCallback = null;
this.disposeTextures();
}
private function disposeTextures() : void {
var local2:BitmapData = null;
var local1:int = 0;
for each(local2 in this.textures) {
local2.dispose();
local1++;
}
this.textures = null;
}
}
}
|
package alternativa.engine3d.loaders.collada {
use namespace collada;
public class DaeElement {
public var document:DaeDocument;
public var data:XML;
private var _parsed:int = -1;
public function DaeElement(param1:XML, param2:DaeDocument) {
super();
this.document = param2;
this.data = param1;
}
public function parse() : Boolean {
if(this._parsed < 0) {
this._parsed = this.parseImplementation() ? 1 : 0;
return this._parsed != 0;
}
return this._parsed != 0;
}
protected function parseImplementation() : Boolean {
return true;
}
protected function parseStringArray(param1:XML) : Array {
return param1.text().toString().split(/\s+/);
}
protected function parseNumbersArray(param1:XML) : Array {
var local5:String = null;
var local2:Array = param1.text().toString().split(/\s+/);
var local3:int = 0;
var local4:int = int(local2.length);
while(local3 < local4) {
local5 = local2[local3];
if(local5.indexOf(",") != -1) {
local5 = local5.replace(/,/,".");
}
local2[local3] = parseFloat(local5);
local3++;
}
return local2;
}
protected function parseIntsArray(param1:XML) : Array {
var local5:String = null;
var local2:Array = param1.text().toString().split(/\s+/);
var local3:int = 0;
var local4:int = int(local2.length);
while(local3 < local4) {
local5 = local2[local3];
local2[local3] = parseInt(local5,10);
local3++;
}
return local2;
}
protected function parseNumber(param1:XML) : Number {
var local2:String = param1.toString().replace(/,/,".");
return parseFloat(local2);
}
public function get id() : String {
var local1:XML = this.data.@id[0];
return local1 == null ? null : local1.toString();
}
public function get sid() : String {
var local1:XML = this.data.@sid[0];
return local1 == null ? null : local1.toString();
}
public function get name() : String {
var local1:XML = this.data.@name[0];
return local1 == null ? null : local1.toString();
}
}
}
|
package controls.buttons.h30px {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/controls.buttons.h30px.GreenMediumButtonSkin_middleDownClass.png")]
public class GreenMediumButtonSkin_middleDownClass extends BitmapAsset {
public function GreenMediumButtonSkin_middleDownClass() {
super();
}
}
}
|
package projects.tanks.client.panel.model.shop.kitview {
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 KitViewButtonWithPriceModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var model:IModel;
public function KitViewButtonWithPriceModelServer(param1:IModel) {
super();
this.model = param1;
var local2:ByteArray = new ByteArray();
this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol));
this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap());
}
}
}
|
package alternativa.tanks.models.tank {
import alternativa.tanks.battle.objects.tank.tankskin.turret.TurretSkinCacheItem;
import flash.utils.Dictionary;
import projects.tanks.clients.flash.resources.resource.Tanks3DSResource;
internal class TurretsRegistry {
private var turrets:Dictionary = new Dictionary();
public function TurretsRegistry() {
super();
}
public function getTurret(param1:Tanks3DSResource) : TurretSkinCacheItem {
var local2:TurretSkinCacheItem = this.turrets[param1.id];
if(local2 == null) {
local2 = new TurretSkinCacheItem(param1);
this.turrets[param1.id] = local2;
}
return local2;
}
}
}
|
package alternativa.tanks.models.weapon.rocketlauncher.weapon {
import alternativa.tanks.models.weapon.WeaponObject;
import flash.utils.getTimer;
public class BuffedShotState implements RocketLauncherWeaponState {
private var weapon:RocketLauncherWeapon;
private var weaponObj:WeaponObject;
public function BuffedShotState(param1:RocketLauncherWeapon, param2:WeaponObject) {
super();
this.weapon = param1;
this.weaponObj = param2;
}
public function start(param1:int) : void {
}
public function stop(param1:int) : void {
}
public function getStatus() : Number {
if(this.weapon.isStunned()) {
return this.weapon.getStunnedStatus();
}
return Math.min(1 - (this.weapon.getReloadingEndTime() - getTimer()) / this.weapon.getReloadingDuration(),1);
}
public function update(param1:int) : void {
if(!this.weapon.isBuffed()) {
this.weapon.onEndingOfSalvo(param1);
return;
}
if(this.weapon.canShoot(param1)) {
this.weapon.simpleShoot(param1);
}
}
public function getReloadTime() : int {
return this.weaponObj.getReloadTimeMS();
}
[Obfuscation(rename="false")]
public function close() : void {
this.weapon = null;
}
public function weaponStunned(param1:int) : void {
}
}
}
|
package projects.tanks.client.battlefield.models.tankparts.sfx.freeze {
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 FreezeSFXModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:FreezeSFXModelServer;
private var client:IFreezeSFXModelBase = IFreezeSFXModelBase(this);
private var modelId:Long = Long.getLong(196518382,153197781);
public function FreezeSFXModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new FreezeSFXModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(FreezeSFXCC,false)));
}
protected function getInitParam() : FreezeSFXCC {
return FreezeSFXCC(initParams[Model.object]);
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
var local3:* = param1;
switch(false ? 0 : 0) {
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package projects.tanks.client.battlefield.models.mapbonuslight {
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 MapBonusLightModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:MapBonusLightModelServer;
private var client:IMapBonusLightModelBase = IMapBonusLightModelBase(this);
private var modelId:Long = Long.getLong(393217538,1110646825);
public function MapBonusLightModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new MapBonusLightModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(MapBonusLightCC,false)));
}
protected function getInitParam() : MapBonusLightCC {
return MapBonusLightCC(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;
}
}
}
|
/* Author: Lucas Lorentz Lara - 25/09/2008
*/
package com.lorentz.SVG.utils{
public class SVGColorUtils {
private static var colors:Object = {};
colors["aliceblue"] = 0xF0F8FF;
colors["antiquewhite"] = 0xFAEBD7;
colors["aqua"] = 0x00FFFF;
colors["aquamarine"] = 0x7FFFD4;
colors["azure"] = 0xF0FFFF;
colors["beige"] = 0xF5F5DC;
colors["bisque"] = 0xFFE4C4;
colors["black"] = 0x000000;
colors["blanchedalmond"] = 0xFFEBCD;
colors["blue"] = 0x0000FF;
colors["blueviolet"] = 0x8A2BE2;
colors["brown"] = 0xA52A2A;
colors["burlywood"] = 0xDEB887;
colors["cadetblue"] = 0x5F9EA0;
colors["chartreuse"] = 0x7FFF00;
colors["chocolate"] = 0xD2691E;
colors["coral"] = 0xFF7F50;
colors["cornflowerblue"] = 0x6495ED;
colors["cornsilk"] = 0xFFF8DC;
colors["crimson"] = 0xDC143C;
colors["cyan"] = 0x00FFFF;
colors["darkblue"] = 0x00008B;
colors["darkcyan"] = 0x008B8B;
colors["darkgoldenrod"] = 0xB8860B;
colors["darkgray"] = 0xA9A9A9;
colors["darkgrey"] = 0xA9A9A9;
colors["darkgreen"] = 0x006400;
colors["darkkhaki"] = 0xBDB76B;
colors["darkmagenta"] = 0x8B008B;
colors["darkolivegreen"] = 0x556B2F;
colors["darkorange"] = 0xFF8C00;
colors["darkorchid"] = 0x9932CC;
colors["darkred"] = 0x8B0000;
colors["darksalmon"] = 0xE9967A;
colors["darkseagreen"] = 0x8FBC8F;
colors["darkslateblue"] = 0x483D8B;
colors["darkslategray"] = 0x2F4F4F;
colors["darkslategrey"] = 0x2F4F4F;
colors["darkturquoise"] = 0x00CED1;
colors["darkviolet"] = 0x9400D3;
colors["deeppink"] = 0xFF1493;
colors["deepskyblue"] = 0x00BFFF;
colors["dimgray"] = 0x696969;
colors["dimgrey"] = 0x696969;
colors["dodgerblue"] = 0x1E90FF;
colors["firebrick"] = 0xB22222;
colors["floralwhite"] = 0xFFFAF0;
colors["forestgreen"] = 0x228B22;
colors["fuchsia"] = 0xFF00FF;
colors["gainsboro"] = 0xDCDCDC;
colors["ghostwhite"] = 0xF8F8FF;
colors["gold"] = 0xFFD700;
colors["goldenrod"] = 0xDAA520;
colors["gray"] = 0x808080;
colors["grey"] = 0x808080;
colors["green"] = 0x008000;
colors["greenyellow"] = 0xADFF2F;
colors["honeydew"] = 0xF0FFF0;
colors["hotpink"] = 0xFF69B4;
colors["indianred"] = 0xCD5C5C;
colors["indigo"] = 0x4B0082;
colors["ivory"] = 0xFFFFF0;
colors["khaki"] = 0xF0E68C;
colors["lavender"] = 0xE6E6FA;
colors["lavenderblush"] = 0xFFF0F5;
colors["lawngreen"] = 0x7CFC00;
colors["lemonchiffon"] = 0xFFFACD;
colors["lightblue"] = 0xADD8E6;
colors["lightcoral"] = 0xF08080;
colors["lightcyan"] = 0xE0FFFF;
colors["lightgoldenrodyellow"] = 0xFAFAD2;
colors["lightgray"] = 0xD3D3D3;
colors["lightgrey"] = 0xD3D3D3;
colors["lightgreen"] = 0x90EE90;
colors["lightpink"] = 0xFFB6C1;
colors["lightsalmon"] = 0xFFA07A;
colors["lightseagreen"] = 0x20B2AA;
colors["lightskyblue"] = 0x87CEFA;
colors["lightslategray"] = 0x778899;
colors["lightslategrey"] = 0x778899;
colors["lightsteelblue"] = 0xB0C4DE;
colors["lightyellow"] = 0xFFFFE0;
colors["lime"] = 0x00FF00;
colors["limegreen"] = 0x32CD32;
colors["linen"] = 0xFAF0E6;
colors["magenta"] = 0xFF00FF;
colors["maroon"] = 0x800000;
colors["mediumaquamarine"] = 0x66CDAA;
colors["mediumblue"] = 0x0000CD;
colors["mediumorchid"] = 0xBA55D3;
colors["mediumpurple"] = 0x9370D8;
colors["mediumseagreen"] = 0x3CB371;
colors["mediumslateblue"] = 0x7B68EE;
colors["mediumspringgreen"] = 0x00FA9A;
colors["mediumturquoise"] = 0x48D1CC;
colors["mediumvioletred"] = 0xC71585;
colors["midnightblue"] = 0x191970;
colors["mintcream"] = 0xF5FFFA;
colors["mistyrose"] = 0xFFE4E1;
colors["moccasin"] = 0xFFE4B5;
colors["navajowhite"] = 0xFFDEAD;
colors["navy"] = 0x000080;
colors["oldlace"] = 0xFDF5E6;
colors["olive"] = 0x808000;
colors["olivedrab"] = 0x6B8E23;
colors["orange"] = 0xFFA500;
colors["orangered"] = 0xFF4500;
colors["orchid"] = 0xDA70D6;
colors["palegoldenrod"] = 0xEEE8AA;
colors["palegreen"] = 0x98FB98;
colors["paleturquoise"] = 0xAFEEEE;
colors["palevioletred"] = 0xD87093;
colors["papayawhip"] = 0xFFEFD5;
colors["peachpuff"] = 0xFFDAB9;
colors["peru"] = 0xCD853F;
colors["pink"] = 0xFFC0CB;
colors["plum"] = 0xDDA0DD;
colors["powderblue"] = 0xB0E0E6;
colors["purple"] = 0x800080;
colors["red"] = 0xFF0000;
colors["rosybrown"] = 0xBC8F8F;
colors["royalblue"] = 0x4169E1;
colors["saddlebrown"] = 0x8B4513;
colors["salmon"] = 0xFA8072;
colors["sandybrown"] = 0xF4A460;
colors["seagreen"] = 0x2E8B57;
colors["seashell"] = 0xFFF5EE;
colors["sienna"] = 0xA0522D;
colors["silver"] = 0xC0C0C0;
colors["skyblue"] = 0x87CEEB;
colors["slateblue"] = 0x6A5ACD;
colors["slategray"] = 0x708090;
colors["slategrey"] = 0x708090;
colors["snow"] = 0xFFFAFA;
colors["springgreen"] = 0x00FF7F;
colors["steelblue"] = 0x4682B4;
colors["tan"] = 0xD2B48C;
colors["teal"] = 0x008080;
colors["thistle"] = 0xD8BFD8;
colors["tomato"] = 0xFF6347;
colors["turquoise"] = 0x40E0D0;
colors["violet"] = 0xEE82EE;
colors["wheat"] = 0xF5DEB3;
colors["white"] = 0xFFFFFF;
colors["whitesmoke"] = 0xF5F5F5;
colors["yellow"] = 0xFFFF00;
colors["yellowgreen"] = 0x9ACD32;
public static function getColorByName(name:String):uint {
return colors[name.toLowerCase()];
}
public static function parseToUint(s:String):uint {
if(s == null)
return 0x000000;
s = StringUtil.trim(s);
if(s=="none" || s==""){
return 0x000000;
} else if(s.charAt(0)=="#") {
s = s.substring(1);
if(s.length < 6)
s = s.charAt(0) + s.charAt(0)+ s.charAt(1) + s.charAt(1) + s.charAt(2) + s.charAt(2);
return new uint("0x" + s);
} else {
var rgb:Array = (/\s*rgb\s*\(\s*(.*?)\s*,\s*(.*?)\s*,\s*(.*?)\s*\)/g).exec(s);
if(rgb != null)
{
var r:uint = rgbColorPartToUint(rgb[1]);
var g:uint = rgbColorPartToUint(rgb[2]);
var b:uint = rgbColorPartToUint(rgb[3]);
return r << 16 | g << 8 | b;
} else {
return getColorByName(s);
}
}
}
private static function rgbColorPartToUint(s:String):uint {
if(s.indexOf("%") != -1)
return Number(s.replace("%", "")) / 100 * 255;
else
return uint(s);
}
public static function uintToSVG(color:uint):String{
var colorText:String = color.toString(16);
while (colorText.length < 6) {
colorText = "0" + colorText;
}
return "#"+colorText;
}
}
}
|
package _codec.projects.tanks.client.battlefield.models.coloradjust {
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.coloradjust.ColorAdjustCC;
public class VectorCodecColorAdjustCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecColorAdjustCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(ColorAdjustCC,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.<ColorAdjustCC> = new Vector.<ColorAdjustCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = ColorAdjustCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:ColorAdjustCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<ColorAdjustCC> = Vector.<ColorAdjustCC>(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.sfx.shoot.plasma
{
import alternativa.engine3d.materials.Material;
import alternativa.tanks.engine3d.TextureAnimation;
import flash.geom.ColorTransform;
import flash.media.Sound;
public class PlasmaSFXData
{
public var shotMaterials:Vector.<Material>;
public var explosionMaterials:Vector.<Material>;
public var shotFlashMaterial:Material;
public var shotSound:Sound;
public var explosionSound:Sound;
public var colorTransform:ColorTransform;
public var shotData:TextureAnimation;
public var explosionData:TextureAnimation;
public var flashData:TextureAnimation;
public function PlasmaSFXData()
{
super();
}
}
}
|
package _codec.projects.tanks.client.clans.license.user {
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.license.user.LicenseClanUserCC;
public class VectorCodecLicenseClanUserCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecLicenseClanUserCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(LicenseClanUserCC,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.<LicenseClanUserCC> = new Vector.<LicenseClanUserCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = LicenseClanUserCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:LicenseClanUserCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<LicenseClanUserCC> = Vector.<LicenseClanUserCC>(param2);
var local5:int = int(local3.length);
LengthCodecHelper.encodeLength(param1,local5);
var local6:int = 0;
while(local6 < local5) {
this.elementCodec.encode(param1,local3[local6]);
local6++;
}
}
}
}
|
package controls {
import assets.windowinner.bitmaps.WindowComboBG;
import assets.windowinner.elemets.WindowInnerBlink;
import base.DiscreteSprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.geom.Rectangle;
public class TankWindowInner extends DiscreteSprite {
private static const leftClass:Class = TankWindowInner_leftClass;
private static const rightClass:Class = TankWindowInner_rightClass;
private static const bottomClass:Class = TankWindowInner_bottomClass;
private static const topClass:Class = TankWindowInner_topClass;
private static const topLeftClass:Class = TankWindowInner_topLeftClass;
private static const topRightClass:Class = TankWindowInner_topRightClass;
private static const bottomLeftClass:Class = TankWindowInner_bottomLeftClass;
private static const bottomRightClass:Class = TankWindowInner_bottomRightClass;
public static const RED:uint = 4284618496;
public static const BLUE:uint = 4278201433;
public static const GREEN:uint = 4278985229;
public static const TRANSPARENT:uint = 16744512;
private static var topBMP:BitmapData = new topClass().bitmapData;
private static var bottomBMP:BitmapData = new bottomClass().bitmapData;
private static var leftBMP:BitmapData = new leftClass().bitmapData;
private static var rightBMP:BitmapData = new rightClass().bitmapData;
private static var topLeftBMP:BitmapData = new topLeftClass().bitmapData;
private static var topRightBMP:BitmapData = new topRightClass().bitmapData;
private static var bottomLeftBMP:BitmapData = new bottomLeftClass().bitmapData;
private static var bottomRightBMP:BitmapData = new bottomRightClass().bitmapData;
private var _width:int;
private var _height:int;
private var bgBMP:BitmapData;
private var blink:WindowInnerBlink = new WindowInnerBlink();
private var bg:Sprite = new Sprite();
private var top:Bitmap;
private var left:Bitmap;
private var right:Bitmap;
private var bottom:Bitmap;
private var topLeft:Bitmap;
private var topRight:Bitmap;
private var bottomRight:Bitmap;
private var bottomLeft:Bitmap;
private var _color:uint;
public function TankWindowInner(param1:int = -1, param2:int = -1, param3:uint = 0) {
super();
this._width = param1;
this._height = param2;
this.bgBMP = param3 == 100 ? new WindowComboBG() as BitmapData : new BitmapData(1,1,true,param3);
this.ConfigUI();
this.draw();
this._color = param3;
}
override public function set width(param1:Number) : void {
this._width = Math.floor(param1);
this.draw();
}
override public function set height(param1:Number) : void {
this._height = Math.floor(param1);
this.draw();
}
private function ConfigUI() : void {
this._width = this._width == -1 ? int(scaleX * 100) : this._width;
this._height = this._height == -1 ? int(scaleY * 100) : this._height;
scaleX = 1;
scaleY = 1;
addChild(this.bg);
this.top = new Bitmap(topBMP);
addChild(this.top);
this.bottom = new Bitmap(bottomBMP);
addChild(this.bottom);
this.left = new Bitmap(leftBMP);
addChild(this.left);
this.right = new Bitmap(rightBMP);
addChild(this.right);
this.topLeft = new Bitmap(topLeftBMP);
addChild(this.topLeft);
this.topRight = new Bitmap(topRightBMP);
addChild(this.topRight);
this.bottomLeft = new Bitmap(bottomLeftBMP);
addChild(this.bottomLeft);
this.bottomRight = new Bitmap(bottomRightBMP);
addChild(this.bottomRight);
}
private function draw() : void {
var local1:Rectangle = new Rectangle(0,0,this._width - 2,this._height - 2);
graphics.clear();
graphics.beginBitmapFill(this.bgBMP);
graphics.drawRect(1,1,this._width - 2,this._height - 2);
graphics.endFill();
this.top.x = 6;
this.top.y = 0;
this.top.width = this._width - 12;
this.bottom.x = 6;
this.bottom.y = this._height - 6;
this.bottom.width = this._width - 12;
this.left.x = 0;
this.left.y = 6;
this.left.height = this._height - 12;
this.right.x = this._width - 6;
this.right.y = 6;
this.right.height = this._height - 12;
this.topLeft.x = 0;
this.topRight.x = this._width - 6;
this.bottomRight.y = this.bottomLeft.y = this._height - 6;
this.bottomLeft.x = 0;
this.bottomRight.x = this._width - 6;
this.blink.width = this._width - 2;
this.blink.height = 174 * ((this._width - 2) / 310);
this.bg.scrollRect = local1;
}
public function set showBlink(param1:Boolean) : void {
var local2:int = 0;
if(param1) {
this.bg.addChild(this.blink);
this.blink.x = this.blink.y = 1;
switch(this._color) {
case GREEN:
local2 = 1;
break;
case BLUE:
local2 = 2;
break;
case RED:
local2 = 3;
}
this.blink.gotoAndStop(local2);
}
}
}
}
|
package _codec.projects.tanks.client.battlefield.models.ultimate.effects.hornet.radar {
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.ultimate.effects.hornet.radar.BattleUltimateRadarCC;
public class VectorCodecBattleUltimateRadarCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecBattleUltimateRadarCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(BattleUltimateRadarCC,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.<BattleUltimateRadarCC> = new Vector.<BattleUltimateRadarCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = BattleUltimateRadarCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:BattleUltimateRadarCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<BattleUltimateRadarCC> = Vector.<BattleUltimateRadarCC>(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 projects.tanks.client.garage.models.item.grouped {
public class GroupedCC {
private var _group:int;
private var _grouped:Boolean;
public function GroupedCC(param1:int = 0, param2:Boolean = false) {
super();
this._group = param1;
this._grouped = param2;
}
public function get group() : int {
return this._group;
}
public function set group(param1:int) : void {
this._group = param1;
}
public function get grouped() : Boolean {
return this._grouped;
}
public function set grouped(param1:Boolean) : void {
this._grouped = param1;
}
public function toString() : String {
var local1:String = "GroupedCC [";
local1 += "group = " + this.group + " ";
local1 += "grouped = " + this.grouped + " ";
return local1 + "]";
}
}
}
|
package projects.tanks.client.garage.models.shopabonement {
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 ShopAbonementModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:ShopAbonementModelServer;
private var client:IShopAbonementModelBase = IShopAbonementModelBase(this);
private var modelId:Long = Long.getLong(1025127866,1054194996);
public function ShopAbonementModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new ShopAbonementModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(ShopAbonementCC,false)));
}
protected function getInitParam() : ShopAbonementCC {
return ShopAbonementCC(initParams[Model.object]);
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
var local3:* = param1;
switch(false ? 0 : 0) {
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package projects.tanks.clients.fp10.Prelauncher.controls.selector {
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Shape;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Rectangle;
import flash.ui.Mouse;
import flash.ui.MouseCursor;
import projects.tanks.clients.fp10.Prelauncher.Locale;
import projects.tanks.clients.fp10.Prelauncher.controls.LocalizedControl;
import projects.tanks.clients.fp10.Prelauncher.controls.selector.flagbutton.FlagButton;
import projects.tanks.clients.fp10.Prelauncher.makeup.MakeUp;
public class LocalizationSelector extends LocalizedControl {
private static var panel:Class = LocalizationSelector_panel;
private static var panelData:BitmapData = (new panel() as Bitmap).bitmapData;
private static var WIDTH:Number = 78;
private static var HEIGHT:Number = 48;
private var _localesList:LocalesList;
private var _flag:FlagButton;
private var _triangle:Bitmap;
private var _triangleGreen:Bitmap;
private var _panel:Shape;
public function LocalizationSelector() {
super();
this._panel = new Shape();
this._triangle = MakeUp.getDropMakeUp();
this._triangleGreen = MakeUp.getDropGreenMakeUp();
this._triangle.x = 47;
this._triangle.y = 18;
this._triangleGreen.x = this._triangle.x;
this._triangleGreen.y = this._triangle.y;
this.createEvents();
}
private function createEvents() : void {
addEventListener(LocaleSelectionEvent.SELECTION,this.addFlag);
addEventListener(MouseEvent.CLICK,this.click);
addEventListener(MouseEvent.MOUSE_OVER,function(e:MouseEvent):void {
Mouse.cursor = MouseCursor.BUTTON;
});
addEventListener(MouseEvent.MOUSE_OUT,function(e:MouseEvent):void {
Mouse.cursor = MouseCursor.AUTO;
});
}
override protected function onResize(e:Event) : void {
this.x = stage.stageWidth - WIDTH - 7;
this.y = 3;
this.drawPanel();
addChild(this._panel);
addChild(this._triangle);
this.addFlag();
}
private function drawPanel() : void {
var top:Number = NaN;
var j:int = 0;
var rect:Rectangle = new Rectangle(9,9,26,26);
var gridX:Array = [rect.left,rect.right,panelData.width];
var gridY:Array = [rect.top,rect.bottom,panelData.height];
this._panel.graphics.clear();
var left:Number = 0;
for(var i:int = 0; i < 3; i++) {
top = 0;
for(j = 0; j < 3; j++) {
this._panel.graphics.beginBitmapFill(panelData);
this._panel.graphics.drawRect(left,top,gridX[i] - left,gridY[j] - top);
this._panel.graphics.endFill();
top = Number(gridY[j]);
}
left = Number(gridX[i]);
}
this._panel.scale9Grid = rect;
this._panel.scaleX = WIDTH / panelData.width;
this._panel.scaleY = HEIGHT / panelData.height;
}
public function closeList() : void {
this.removeChildren();
addChild(this._panel);
addChild(this._flag);
addChild(this._triangle);
}
private function click(e:MouseEvent) : void {
if(this.numChildren > 3) {
this.closeList();
} else {
addChild(this._triangleGreen);
this.localesList.addFlags();
this.addChild(this.localesList);
}
}
private function get localesList() : LocalesList {
if(this._localesList == null) {
this._localesList = new LocalesList();
}
return this._localesList;
}
private function addFlag(e:LocaleSelectionEvent = null) : void {
var flag:FlagButton = null;
var locale:Locale = null;
for each(flag in this.localesList.flags) {
locale = e == null ? Locale.current : e.locale;
if(flag.locale == locale) {
this._flag = flag;
this._flag.x = 14;
this._flag.y = 15;
this._flag.selectorItem = true;
this._flag.redraw(false);
addChild(flag);
break;
}
}
}
}
}
|
package projects.tanks.client.panel.model.userscounter.panel {
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 UsersCounterPanelModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:UsersCounterPanelModelServer;
private var client:IUsersCounterPanelModelBase = IUsersCounterPanelModelBase(this);
private var modelId:Long = Long.getLong(1626818804,-815772060);
private var _saveUniqueUserIdId:Long = Long.getLong(2097016898,-518819579);
private var _saveUniqueUserId_idCodec:ICodec;
public function UsersCounterPanelModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new UsersCounterPanelModelServer(IModel(this));
this._saveUniqueUserId_idCodec = this._protocol.getCodec(new TypeCodecInfo(Long,false));
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
switch(param1) {
case this._saveUniqueUserIdId:
this.client.saveUniqueUserId(Long(this._saveUniqueUserId_idCodec.decode(param2)));
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package projects.tanks.clients.flash.commons.models.layout {
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.client.commons.models.layout.LayoutState;
public class ILobbyLayoutEvents implements ILobbyLayout {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function ILobbyLayoutEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function showGarage() : void {
var i:int = 0;
var m:ILobbyLayout = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = ILobbyLayout(this.impl[i]);
m.showGarage();
i++;
}
}
finally {
Model.popObject();
}
}
public function showBattleSelect() : void {
var i:int = 0;
var m:ILobbyLayout = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = ILobbyLayout(this.impl[i]);
m.showBattleSelect();
i++;
}
}
finally {
Model.popObject();
}
}
public function showMatchmaking() : void {
var i:int = 0;
var m:ILobbyLayout = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = ILobbyLayout(this.impl[i]);
m.showMatchmaking();
i++;
}
}
finally {
Model.popObject();
}
}
public function showBattleLobby() : void {
var i:int = 0;
var m:ILobbyLayout = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = ILobbyLayout(this.impl[i]);
m.showBattleLobby();
i++;
}
}
finally {
Model.popObject();
}
}
public function showClan() : void {
var i:int = 0;
var m:ILobbyLayout = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = ILobbyLayout(this.impl[i]);
m.showClan();
i++;
}
}
finally {
Model.popObject();
}
}
public function exitFromBattle() : void {
var i:int = 0;
var m:ILobbyLayout = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = ILobbyLayout(this.impl[i]);
m.exitFromBattle();
i++;
}
}
finally {
Model.popObject();
}
}
public function exitFromBattleToState(param1:LayoutState) : void {
var i:int = 0;
var m:ILobbyLayout = null;
var state:LayoutState = param1;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = ILobbyLayout(this.impl[i]);
m.exitFromBattleToState(state);
i++;
}
}
finally {
Model.popObject();
}
}
public function returnToBattle() : void {
var i:int = 0;
var m:ILobbyLayout = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = ILobbyLayout(this.impl[i]);
m.returnToBattle();
i++;
}
}
finally {
Model.popObject();
}
}
}
}
|
package controls.buttons.h30px {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/controls.buttons.h30px.OrangeMediumButtonSkin_middleOverClass.png")]
public class OrangeMediumButtonSkin_middleOverClass extends BitmapAsset {
public function OrangeMediumButtonSkin_middleOverClass() {
super();
}
}
}
|
package alternativa.tanks.models.map {
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.resource.types.SoundResource;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.client.battlefield.models.map.DustParams;
import projects.tanks.client.battlefield.models.map.DynamicShadowParams;
import projects.tanks.client.battlefield.models.map.FogParams;
import projects.tanks.client.battlefield.models.map.SkyboxSides;
import projects.tanks.client.battlefield.types.Vector3d;
import projects.tanks.clients.flash.resources.resource.MapResource;
public class IBattleMapEvents implements IBattleMap {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function IBattleMapEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function getMapResource() : MapResource {
var result:MapResource = null;
var i:int = 0;
var m:IBattleMap = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = IBattleMap(this.impl[i]);
result = m.getMapResource();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
public function getEnvironmentSound() : SoundResource {
var result:SoundResource = null;
var i:int = 0;
var m:IBattleMap = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = IBattleMap(this.impl[i]);
result = m.getEnvironmentSound();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
public function getSkybox() : SkyboxSides {
var result:SkyboxSides = null;
var i:int = 0;
var m:IBattleMap = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = IBattleMap(this.impl[i]);
result = m.getSkybox();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
public function getGravity() : Number {
var result:Number = NaN;
var i:int = 0;
var m:IBattleMap = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = IBattleMap(this.impl[i]);
result = Number(m.getGravity());
i++;
}
}
finally {
Model.popObject();
}
return result;
}
public function getSkyboxRevolutionAxis() : Vector3d {
var result:Vector3d = null;
var i:int = 0;
var m:IBattleMap = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = IBattleMap(this.impl[i]);
result = m.getSkyboxRevolutionAxis();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
public function getSkyBoxRevolutionSpeed() : Number {
var result:Number = NaN;
var i:int = 0;
var m:IBattleMap = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = IBattleMap(this.impl[i]);
result = Number(m.getSkyBoxRevolutionSpeed());
i++;
}
}
finally {
Model.popObject();
}
return result;
}
public function getFogParams() : FogParams {
var result:FogParams = null;
var i:int = 0;
var m:IBattleMap = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = IBattleMap(this.impl[i]);
result = m.getFogParams();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
public function getDynamicShadowParams() : DynamicShadowParams {
var result:DynamicShadowParams = null;
var i:int = 0;
var m:IBattleMap = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = IBattleMap(this.impl[i]);
result = m.getDynamicShadowParams();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
public function getDustParams() : DustParams {
var result:DustParams = null;
var i:int = 0;
var m:IBattleMap = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = IBattleMap(this.impl[i]);
result = m.getDustParams();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
public function getSSAOColor() : uint {
var result:uint = 0;
var i:int = 0;
var m:IBattleMap = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = IBattleMap(this.impl[i]);
result = uint(m.getSSAOColor());
i++;
}
}
finally {
Model.popObject();
}
return result;
}
}
}
|
package projects.tanks.client.battlefield.models.continuebattle {
import alternativa.osgi.OSGi;
import alternativa.protocol.IProtocol;
import alternativa.protocol.OptionalMap;
import alternativa.protocol.ProtocolBuffer;
import alternativa.types.Long;
import flash.utils.ByteArray;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.network.command.SpaceCommand;
import platform.client.fp10.core.type.IGameObject;
import platform.client.fp10.core.type.ISpace;
public class ContinueBattleModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var _continueBattleId:Long = Long.getLong(1408707863,1141340995);
private var model:IModel;
public function ContinueBattleModelServer(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());
}
public function continueBattle() : void {
ByteArray(this.protocolBuffer.writer).position = 0;
ByteArray(this.protocolBuffer.writer).length = 0;
ByteArray(this.protocolBuffer.writer).position = 0;
if(Model.object == null) {
throw new Error("Execute method without model context.");
}
var local1:SpaceCommand = new SpaceCommand(Model.object.id,this._continueBattleId,this.protocolBuffer);
var local2:IGameObject = Model.object;
var local3:ISpace = local2.space;
local3.commandSender.sendCommand(local1);
this.protocolBuffer.optionalMap.clear();
}
}
}
|
package _codec.projects.tanks.client.panel.model.shop.featuring {
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.panel.model.shop.featuring.ShopItemFeaturingCC;
public class CodecShopItemFeaturingCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_hiddenInOriginalCategory:ICodec;
private var codec_locatedInFeaturingCategory:ICodec;
private var codec_position:ICodec;
public function CodecShopItemFeaturingCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_hiddenInOriginalCategory = param1.getCodec(new TypeCodecInfo(Boolean,false));
this.codec_locatedInFeaturingCategory = param1.getCodec(new TypeCodecInfo(Boolean,false));
this.codec_position = param1.getCodec(new TypeCodecInfo(int,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:ShopItemFeaturingCC = new ShopItemFeaturingCC();
local2.hiddenInOriginalCategory = this.codec_hiddenInOriginalCategory.decode(param1) as Boolean;
local2.locatedInFeaturingCategory = this.codec_locatedInFeaturingCategory.decode(param1) as Boolean;
local2.position = this.codec_position.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:ShopItemFeaturingCC = ShopItemFeaturingCC(param2);
this.codec_hiddenInOriginalCategory.encode(param1,local3.hiddenInOriginalCategory);
this.codec_locatedInFeaturingCategory.encode(param1,local3.locatedInFeaturingCategory);
this.codec_position.encode(param1,local3.position);
}
}
}
|
package alternativa.tanks.sfx {
import alternativa.engine3d.core.Sorting;
import alternativa.engine3d.core.Vertex;
import alternativa.engine3d.objects.Mesh;
import alternativa.tanks.engine3d.TextureAnimation;
import alternativa.tanks.engine3d.UVFrame;
public class AnimatedPlane extends Mesh {
private var a:Vertex;
private var b:Vertex;
private var c:Vertex;
private var d:Vertex;
private var uvFrames:Vector.<UVFrame>;
private var numFrames:int;
private var framesPerTimeUnit:Number = 0;
public function AnimatedPlane(param1:Number, param2:Number, param3:Number = 0, param4:Number = 0, param5:Number = 10) {
super();
this.createFaces(param1,param2,param3,param4,param5);
sorting = Sorting.DYNAMIC_BSP;
calculateBounds();
calculateFacesNormals();
this.writeVertices();
this.softAttenuation = 130;
this.shadowMapAlphaThreshold = 2;
this.depthMapAlphaThreshold = 2;
}
private function createFaces(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number) : void {
var local6:Number = param1 / 2;
var local7:Number = param2 / 2;
var local8:Vector.<Number> = Vector.<Number>([param3 - local6,param4 + local7,param5,param3 - local6,param4 - local7,param5,param3 + local6,param4 - local7,param5,param3 + local6,param4 + local7,param5]);
var local9:Vector.<Number> = Vector.<Number>([0,0,0,1,1,1,1,0]);
var local10:Vector.<int> = Vector.<int>([4,0,1,2,3,4,0,3,2,1]);
addVerticesAndFaces(local8,local9,local10,true);
}
private function writeVertices() : void {
var local1:Vector.<Vertex> = this.vertices;
this.a = local1[0];
this.b = local1[1];
this.c = local1[2];
this.d = local1[3];
}
public function init(param1:TextureAnimation, param2:Number) : void {
setMaterialToAllFaces(param1.material);
this.uvFrames = param1.frames;
this.numFrames = this.uvFrames.length;
this.framesPerTimeUnit = param2;
}
public function setTime(param1:Number) : void {
var local2:int = param1 * this.framesPerTimeUnit;
if(local2 >= this.numFrames) {
local2 = this.numFrames - 1;
}
this.setFrame(this.uvFrames[local2]);
}
public function clear() : void {
setMaterialToAllFaces(null);
this.uvFrames = null;
this.numFrames = 0;
}
public function getOneLoopTime() : Number {
return this.numFrames / this.framesPerTimeUnit;
}
private function setFrame(param1:UVFrame) : void {
this.a.u = param1.topLeftU;
this.a.v = param1.topLeftV;
this.b.u = param1.topLeftU;
this.b.v = param1.bottomRightV;
this.c.u = param1.bottomRightU;
this.c.v = param1.bottomRightV;
this.d.u = param1.bottomRightU;
this.d.v = param1.topLeftV;
}
}
}
|
package alternativa.tanks.models.battle.gui.inventory {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.models.battle.gui.inventory.HudInventoryIcon_overdriveJuggernautIconClass.png")]
public class HudInventoryIcon_overdriveJuggernautIconClass extends BitmapAsset {
public function HudInventoryIcon_overdriveJuggernautIconClass() {
super();
}
}
}
|
package com.lorentz.SVG.utils
{
public class StringUtil
{
/**
* Removes whitespace from the front and the end of the specified
* string.
*
* @param input The String whose beginning and ending whitespace will
* will be removed.
*
* @returns A String with whitespace removed from the begining and end
*
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public static function trim(input:String, char:String=" "):String
{
return StringUtil.ltrim(StringUtil.rtrim(input, char), char);
}
/**
* Removes whitespace from the front of the specified string.
*
* @param input The String whose beginning whitespace will will be removed.
*
* @returns A String with whitespace removed from the begining
*
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public static function ltrim(input:String, char:String=" "):String
{
var size:Number = input.length;
for(var i:Number = 0; i < size; i++)
{
if(input.charAt(i) != char)
{
return input.substring(i);
}
}
return "";
}
/**
* Removes whitespace from the end of the specified string.
*
* @param input The String whose ending whitespace will will be removed.
*
* @returns A String with whitespace removed from the end
*
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public static function rtrim(input:String, char:String=" "):String
{
var size:Number = input.length;
for(var i:Number = size; i > 0; i--)
{
if(input.charAt(i-1) != char)
{
return input.substring(0, i);
}
}
return "";
}
/**
* Removes all instances of the remove string in the input string.
*
* @param input The string that will be checked for instances of remove
* string
*
* @param remove The string that will be removed from the input string.
*
* @returns A String with the remove string removed.
*
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public static function remove(input:String, remove:String):String
{
return StringUtil.replace(input, remove, "");
}
/**
* Replaces all instances of the replace string in the input string
* with the replaceWith string.
*
* @param input The string that instances of replace string will be
* replaces with removeWith string.
*
* @param replace The string that will be replaced by instances of
* the replaceWith string.
*
* @param replaceWith The string that will replace instances of replace
* string.
*
* @returns A new String with the replace string replaced with the
* replaceWith string.
*
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public static function replace(input:String, replace:String, replaceWith:String):String
{
//change to StringBuilder
var sb:String = new String();
var found:Boolean = false;
var sLen:Number = input.length;
var rLen:Number = replace.length;
for (var i:Number = 0; i < sLen; i++)
{
if(input.charAt(i) == replace.charAt(0))
{
found = true;
for(var j:Number = 0; j < rLen; j++)
{
if(!(input.charAt(i + j) == replace.charAt(j)))
{
found = false;
break;
}
}
if(found)
{
sb += replaceWith;
i = i + (rLen - 1);
continue;
}
}
sb += input.charAt(i);
}
//TODO : if the string is not found, should we return the original
//string?
return sb;
}
/**
* @method shrinkSequencesOf (Groleau)
* @description Shrinks all sequences of a given character in a string to one
* @param s (String) original string
* @param ch (String) character to be found
* @returns (String) string with sequences shrunk
*/
public static function shrinkSequencesOf(s:String, ch:String):String {
var len:int = s.length;
var idx:int = 0;
var idx2:int = 0;
var rs:String = "";
while ((idx2 = s.indexOf(ch, idx) + 1) != 0) {
// include string up to first character in sequence
rs += s.substring(idx, idx2);
idx = idx2;
// remove all subsequent characters in sequence
while ((s.charAt(idx) == ch) && (idx < len)) idx++;
}
return rs + s.substring(idx, len);
}
}
}
|
package projects.tanks.client.panel.model.payment {
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 PaymentModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:PaymentModelServer;
private var client:IPaymentModelBase = IPaymentModelBase(this);
private var modelId:Long = Long.getLong(330013883,1971598924);
public function PaymentModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new PaymentModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(PaymentCC,false)));
}
protected function getInitParam() : PaymentCC {
return PaymentCC(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 controls.rangicons
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class RangsIcon_p8 extends BitmapAsset
{
public function RangsIcon_p8()
{
super();
}
}
}
|
package projects.tanks.client.partners.impl.fakepartner {
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 FakePartnerLoginModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:FakePartnerLoginModelServer;
private var client:IFakePartnerLoginModelBase = IFakePartnerLoginModelBase(this);
private var modelId:Long = Long.getLong(788926934,-2079503035);
public function FakePartnerLoginModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new FakePartnerLoginModelServer(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.gui.components.indicators {
import alternativa.tanks.gui.IClanNotificationListener;
import controls.base.LabelBase;
public class LabelNewIndicator extends LabelBase implements IClanNotificationListener {
public function LabelNewIndicator() {
super();
}
public function updateNotifications() : void {
}
public function hide() : void {
}
public function show() : void {
}
}
}
|
package projects.tanks.client.panel.model.payment.modes.braintree {
import alternativa.osgi.OSGi;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.registry.ModelRegistry;
import projects.tanks.client.panel.model.payment.types.PaymentRequestUrl;
public class BraintreePaymentModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:BraintreePaymentModelServer;
private var client:IBraintreePaymentModelBase = IBraintreePaymentModelBase(this);
private var modelId:Long = Long.getLong(176586390,-1429295990);
private var _receiveUrlId:Long = Long.getLong(2063915763,-1081638167);
private var _receiveUrl_urlCodec:ICodec;
public function BraintreePaymentModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new BraintreePaymentModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(BraintreePaymentCC,false)));
this._receiveUrl_urlCodec = this._protocol.getCodec(new TypeCodecInfo(PaymentRequestUrl,false));
}
protected function getInitParam() : BraintreePaymentCC {
return BraintreePaymentCC(initParams[Model.object]);
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
switch(param1) {
case this._receiveUrlId:
this.client.receiveUrl(PaymentRequestUrl(this._receiveUrl_urlCodec.decode(param2)));
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package alternativa.engine3d.core
{
public class Clipping
{
public static const BOUND_CULLING:int = 0;
public static const FACE_CULLING:int = 1;
public static const FACE_CLIPPING:int = 2;
public function Clipping()
{
super();
}
}
}
|
package projects.tanks.client.panel.model.shop.kitpackage
{
public class KitPackageItemInfo
{
private var _count:int;
private var _crystalPrice:int;
private var _itemName:String;
public function KitPackageItemInfo(param1:int = 0, param2:int = 0, param3:String = null)
{
super();
this._count = param1;
this._crystalPrice = param2;
this._itemName = param3;
}
public function get count() : int
{
return this._count;
}
public function set count(param1:int) : void
{
this._count = param1;
}
public function get crystalPrice() : int
{
return this._crystalPrice;
}
public function set crystalPrice(param1:int) : void
{
this._crystalPrice = param1;
}
public function get itemName() : String
{
return this._itemName;
}
public function set itemName(param1:String) : void
{
this._itemName = param1;
}
public function toString() : String
{
var _loc1_:String = "KitPackageItemInfo [";
_loc1_ += "count = " + this.count + " ";
_loc1_ += "crystalPrice = " + this.crystalPrice + " ";
_loc1_ += "itemName = " + this.itemName + " ";
return _loc1_ + "]";
}
}
}
|
package platform.clients.fp10.libraries.alternativapartners.type {
[ModelInterface]
public interface IPartner {
function getLoginParameters(param1:IParametersListener) : void;
function hasPaymentAction() : Boolean;
function paymentAction() : void;
function getFailRedirectUrl() : String;
function isExternalLoginAllowed() : Boolean;
function hasRatings() : Boolean;
}
}
|
package projects.tanks.clients.fp10.models.tankspartnersmodel.partners.rambler {
import flash.utils.Dictionary;
import platform.client.core.general.socialnetwork.types.LoginParameters;
import platform.client.fp10.core.service.address.AddressService;
import platform.clients.fp10.libraries.alternativapartners.type.IParametersListener;
import platform.clients.fp10.libraries.alternativapartners.type.IPartner;
import projects.tanks.client.partners.impl.rambler.IRamblerLoginModelBase;
import projects.tanks.client.partners.impl.rambler.RamblerLoginModelBase;
[ModelInfo]
public class RamblerLoginModel extends RamblerLoginModelBase implements IRamblerLoginModelBase, IPartner {
[Inject]
public static var addressService:AddressService;
private static const USER_ID_PARAM:String = "user_id";
private static const GAME_ID_PARAM:String = "game_id";
private static const SLUG_PARAM:String = "slug";
private static const TIMESTAMP_PARAM:String = "timestamp";
private static const SIG_PARAM:String = "sig";
public function RamblerLoginModel() {
super();
}
public function getLoginParameters(param1:IParametersListener) : void {
var local2:Dictionary = new Dictionary();
local2[USER_ID_PARAM] = addressService.getQueryParameter(USER_ID_PARAM);
local2[GAME_ID_PARAM] = addressService.getQueryParameter(GAME_ID_PARAM);
local2[SLUG_PARAM] = addressService.getQueryParameter(SLUG_PARAM);
local2[TIMESTAMP_PARAM] = addressService.getQueryParameter(TIMESTAMP_PARAM);
local2[SIG_PARAM] = addressService.getQueryParameter(SIG_PARAM);
param1.onSetParameters(new LoginParameters(local2));
}
public function getFailRedirectUrl() : String {
return "http://www.tankionline.com/";
}
public function isExternalLoginAllowed() : Boolean {
return false;
}
public function hasPaymentAction() : Boolean {
return false;
}
public function paymentAction() : void {
}
public function hasRatings() : Boolean {
return true;
}
}
}
|
package alternativa.tanks.gui.device {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.device.DevicesIcons_lockedIconClass.png")]
public class DevicesIcons_lockedIconClass extends BitmapAsset {
public function DevicesIcons_lockedIconClass() {
super();
}
}
}
|
package alternativa.tanks.services.battleinput {
import flash.events.IEventDispatcher;
public interface BattleInputService extends IEventDispatcher {
function lock(param1:BattleInputLockType) : void;
function unlock(param1:BattleInputLockType) : void;
function lockMouseLocking(param1:MouseLockLockType) : void;
function unlockMouseLocking(param1:MouseLockLockType) : void;
function isInputLocked() : Boolean;
function addGameActionListener(param1:GameActionListener) : void;
function removeGameActionListener(param1:GameActionListener) : void;
function addMouseLockListener(param1:MouseLockListener) : void;
function removeMouseLockListener(param1:MouseLockListener) : void;
function addMouseMoveListener(param1:MouseMovementListener) : void;
function removeMouseMoveListener(param1:MouseMovementListener) : void;
function addMouseWheelListener(param1:MouseWheelListener) : void;
function removeMouseWheelListener(param1:MouseWheelListener) : void;
function releaseMouse() : void;
function forbidMouseLock() : void;
function allowMouseLock() : void;
}
}
|
package projects.tanks.client.battleselect.model.buyabonement {
import alternativa.osgi.OSGi;
import alternativa.protocol.IProtocol;
import alternativa.protocol.OptionalMap;
import alternativa.protocol.ProtocolBuffer;
import alternativa.types.Long;
import flash.utils.ByteArray;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.network.command.SpaceCommand;
import platform.client.fp10.core.type.IGameObject;
import platform.client.fp10.core.type.ISpace;
public class BuyProAbonementModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var _selectProBattlePassId:Long = Long.getLong(549362390,-1945984908);
private var model:IModel;
public function BuyProAbonementModelServer(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());
}
public function selectProBattlePass() : void {
ByteArray(this.protocolBuffer.writer).position = 0;
ByteArray(this.protocolBuffer.writer).length = 0;
ByteArray(this.protocolBuffer.writer).position = 0;
if(Model.object == null) {
throw new Error("Execute method without model context.");
}
var local1:SpaceCommand = new SpaceCommand(Model.object.id,this._selectProBattlePassId,this.protocolBuffer);
var local2:IGameObject = Model.object;
var local3:ISpace = local2.space;
local3.commandSender.sendCommand(local1);
this.protocolBuffer.optionalMap.clear();
}
}
}
|
package alternativa.tanks.models.tank {
[ModelInterface]
public interface RemoveFromBattleListener {
function onRemoveFromBattle() : void;
}
}
|
package alternativa.tanks.models.dom
{
public interface IDOMModel
{
}
}
|
package alternativa.tanks.model.quest.common.notification {
import platform.client.fp10.core.model.ObjectLoadPostListener;
import platform.client.fp10.core.model.ObjectUnloadListener;
import projects.tanks.client.panel.model.quest.QuestTypeEnum;
import projects.tanks.client.panel.model.quest.notifier.IQuestNotifierModelBase;
import projects.tanks.client.panel.model.quest.notifier.QuestNotifierCC;
import projects.tanks.client.panel.model.quest.notifier.QuestNotifierModelBase;
[ModelInfo]
public class QuestNotifierModel extends QuestNotifierModelBase implements IQuestNotifierModelBase, ObjectLoadPostListener, ObjectUnloadListener {
[Inject]
public static var questNotifierService:QuestNotifierService;
public function QuestNotifierModel() {
super();
}
public function objectLoadedPost() : void {
var local1:QuestNotifierCC = getInitParam();
if(local1.hasCompletedDailyQuests || local1.hasNewDailyQuests) {
questNotifierService.showChanges(QuestTypeEnum.DAILY);
}
if(local1.hasCompletedWeeklyQuests || local1.hasNewWeeklyQuests) {
questNotifierService.showChanges(QuestTypeEnum.WEEKLY);
}
questNotifierService.addEventListener(QuestNotificationEvent.HIDE_NOTIFICATION,getFunctionWrapper(this.onHideNotification));
}
public function newInDailyQuests() : void {
questNotifierService.showChanges(QuestTypeEnum.DAILY);
}
public function newInWeeklyQuests() : void {
questNotifierService.showChanges(QuestTypeEnum.WEEKLY);
}
public function completedDailyQuest() : void {
questNotifierService.showChanges(QuestTypeEnum.DAILY);
}
public function completedWeeklyQuests() : void {
questNotifierService.showChanges(QuestTypeEnum.WEEKLY);
}
private function onHideNotification(param1:QuestNotificationEvent) : void {
switch(param1.questType) {
case QuestTypeEnum.DAILY:
server.completedDailyQuestViewed();
server.newDailyQuestViewed();
break;
case QuestTypeEnum.WEEKLY:
server.completedWeeklyQuestViewed();
server.newWeeklyQuestViewed();
}
}
public function objectUnloaded() : void {
questNotifierService.removeEventListener(QuestNotificationEvent.HIDE_NOTIFICATION,getFunctionWrapper(this.onHideNotification));
}
}
}
|
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.CollectionCodecInfo;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.garage.models.item.properties.ItemGaragePropertyData;
import projects.tanks.client.garage.models.item.properties.ItemPropertiesCC;
public class CodecItemPropertiesCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_properties:ICodec;
public function CodecItemPropertiesCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_properties = param1.getCodec(new CollectionCodecInfo(new TypeCodecInfo(ItemGaragePropertyData,false),false,1));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:ItemPropertiesCC = new ItemPropertiesCC();
local2.properties = this.codec_properties.decode(param1) as Vector.<ItemGaragePropertyData>;
return local2;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:ItemPropertiesCC = ItemPropertiesCC(param2);
this.codec_properties.encode(param1,local3.properties);
}
}
}
|
package alternativa.tanks.model.item.discount {
[ModelInterface]
public interface IDiscount {
function getDiscountInPercent() : int;
function applyDiscount(param1:int) : int;
}
}
|
package alternativa.engine3d.core
{
import alternativa.engine3d.alternativa3d;
import alternativa.gfx.core.Device;
import alternativa.gfx.core.IndexBufferResource;
import alternativa.gfx.core.ProgramResource;
import alternativa.gfx.core.RenderTargetTextureResource;
import alternativa.gfx.core.VertexBufferResource;
import flash.display3D.Context3DProgramType;
import flash.display3D.Context3DVertexBufferFormat;
import flash.utils.ByteArray;
use namespace alternativa3d;
public class ShadowAtlas
{
alternativa3d static const sizeLimit:int = 1024;
private static var blurPrograms:Array = new Array();
private static var blurVertexBuffer:VertexBufferResource = new VertexBufferResource(Vector.<Number>([-1,1,0,0,0,-1,-1,0,0,1,1,-1,0,1,1,1,1,0,1,0]),5);
private static var blurIndexBuffer:IndexBufferResource = new IndexBufferResource(Vector.<uint>([0,1,3,2,3,1]));
private static var blurConst:Vector.<Number> = Vector.<Number>([0,0,0,1,0,0,0,1]);
alternativa3d var shadows:Vector.<Shadow>;
alternativa3d var shadowsCount:int = 0;
private var mapSize:int;
private var blur:int;
private var maps:Array;
private var map1:RenderTargetTextureResource;
private var map2:RenderTargetTextureResource;
public function ShadowAtlas(param1:int, param2:int)
{
this.shadows = new Vector.<Shadow>();
this.maps = new Array();
super();
this.mapSize = param1;
this.blur = param2;
}
alternativa3d function renderCasters(param1:Camera3D) : void
{
var _loc9_:Shadow = null;
var _loc2_:Device = param1.device;
var _loc3_:int = sizeLimit / this.mapSize;
var _loc4_:int = Math.ceil(this.shadowsCount / _loc3_);
var _loc5_:int = this.shadowsCount > _loc3_ ? int(int(_loc3_)) : int(int(this.shadowsCount));
_loc4_ = 1 << Math.ceil(Math.log(_loc4_) / Math.LN2);
_loc5_ = 1 << Math.ceil(Math.log(_loc5_) / Math.LN2);
if(_loc4_ > _loc3_)
{
_loc4_ = _loc3_;
this.shadowsCount = _loc4_ * _loc5_;
}
var _loc6_:int = _loc4_ << 8 | _loc5_;
this.map1 = this.maps[_loc6_];
var _loc7_:int = 1 << 16 | _loc6_;
this.map2 = this.maps[_loc7_];
if(this.map1 == null)
{
this.map1 = new RenderTargetTextureResource(_loc5_ * this.mapSize,_loc4_ * this.mapSize);
this.map2 = new RenderTargetTextureResource(_loc5_ * this.mapSize,_loc4_ * this.mapSize);
this.maps[_loc6_] = this.map1;
this.maps[_loc7_] = this.map2;
}
_loc2_.setRenderToTexture(this.map1,true);
_loc2_.clear(0,0,0,0,0);
var _loc8_:int = 0;
while(_loc8_ < this.shadowsCount)
{
_loc9_ = this.shadows[_loc8_];
_loc9_.texture = this.map1;
_loc9_.textureScaleU = 1 / _loc5_;
_loc9_.textureScaleV = 1 / _loc4_;
_loc9_.textureOffsetU = _loc8_ % _loc5_ / _loc5_;
_loc9_.textureOffsetV = int(_loc8_ / _loc5_) / _loc4_;
_loc9_.renderCasters(param1);
_loc8_++;
}
}
alternativa3d function renderBlur(param1:Camera3D) : void
{
var _loc2_:Device = param1.device;
if(this.blur > 0)
{
_loc2_.setVertexBufferAt(0,blurVertexBuffer,0,Context3DVertexBufferFormat.FLOAT_3);
_loc2_.setVertexBufferAt(1,blurVertexBuffer,3,Context3DVertexBufferFormat.FLOAT_2);
blurConst[0] = 1 / this.map1.width;
blurConst[1] = 1 / this.map1.height;
blurConst[3] = 1 + this.blur + this.blur;
blurConst[4] = this.blur / this.map1.width;
blurConst[5] = this.blur / this.map1.height;
_loc2_.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT,0,blurConst,2);
_loc2_.setRenderToTexture(this.map2,false);
_loc2_.clear(0,0,0,0);
_loc2_.setProgram(this.getBlurProgram(1,this.blur));
_loc2_.setTextureAt(0,this.map1);
_loc2_.drawTriangles(blurIndexBuffer,0,2);
_loc2_.setRenderToTexture(this.map1,false);
_loc2_.clear(0,0,0,0);
_loc2_.setProgram(this.getBlurProgram(2,this.blur));
_loc2_.setTextureAt(0,this.map2);
_loc2_.drawTriangles(blurIndexBuffer,0,2);
}
}
alternativa3d function clear() : void
{
var _loc2_:Shadow = null;
var _loc1_:int = 0;
while(_loc1_ < this.shadowsCount)
{
_loc2_ = this.shadows[_loc1_];
_loc2_.texture = null;
_loc1_++;
}
this.shadows.length = 0;
this.shadowsCount = 0;
}
private function getBlurProgram(param1:int, param2:int) : ProgramResource
{
var _loc5_:ByteArray = null;
var _loc6_:ByteArray = null;
var _loc3_:int = (param1 << 16) + param2;
var _loc4_:ProgramResource = blurPrograms[_loc3_];
if(_loc4_ == null)
{
_loc5_ = new ShadowAtlasVertexShader().agalcode;
_loc6_ = new ShadowAtlasFragmentShader(param2,param1 == 1).agalcode;
_loc4_ = new ProgramResource(_loc5_,_loc6_);
blurPrograms[_loc3_] = _loc4_;
}
return _loc4_;
}
}
}
|
package alternativa.tanks.model.payment.modes.description {
import alternativa.osgi.service.clientlog.IClientLog;
import platform.client.fp10.core.model.IObjectLoadListener;
import platform.client.fp10.core.resource.types.ImageResource;
import projects.tanks.client.panel.model.payment.modes.description.BottomDescriptionModelBase;
import projects.tanks.client.panel.model.payment.modes.description.IBottomDescriptionModelBase;
[ModelInfo]
public class PayModeBottomDescriptionModel extends BottomDescriptionModelBase implements IBottomDescriptionModelBase, PayModeBottomDescription, PayModeBottomDescriptionInternal, IObjectLoadListener {
[Inject]
public static var clientLog:IClientLog;
public function PayModeBottomDescriptionModel() {
super();
}
public function getDescription() : String {
if(getInitParam().description == null) {
return "";
}
return getInitParam().description;
}
public function getImages() : Vector.<ImageResource> {
return getInitParam().images;
}
public function enabled() : Boolean {
return getData(Boolean);
}
public function setEnabled(param1:Boolean) : void {
putData(Boolean,param1);
}
public function objectLoaded() : void {
putData(Boolean,true);
}
public function objectLoadedPost() : void {
}
public function objectUnloaded() : void {
}
public function objectUnloadedPost() : void {
}
}
}
|
package projects.tanks.client.panel.model.videoads {
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 VideoAdsModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:VideoAdsModelServer;
private var client:IVideoAdsModelBase = IVideoAdsModelBase(this);
private var modelId:Long = Long.getLong(1726595253,-1440123844);
private var _disableId:Long = Long.getLong(1455720671,844804169);
private var _enableId:Long = Long.getLong(601148059,-698196692);
public function VideoAdsModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new VideoAdsModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(VideoAdsModelCC,false)));
}
protected function getInitParam() : VideoAdsModelCC {
return VideoAdsModelCC(initParams[Model.object]);
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
switch(param1) {
case this._disableId:
this.client.disable();
break;
case this._enableId:
this.client.enable();
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package alternativa.tanks.models.tank.ultimate.hunter {
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.core.Object3DContainer;
import alternativa.engine3d.core.Vertex;
import alternativa.engine3d.materials.TextureMaterial;
import alternativa.engine3d.objects.Mesh;
import alternativa.math.Vector3;
import alternativa.tanks.battle.scene3d.scene3dcontainer.Scene3DContainer;
import alternativa.tanks.camera.GameCamera;
import alternativa.tanks.sfx.GraphicEffect;
import alternativa.tanks.sfx.Sound3D;
import alternativa.tanks.utils.objectpool.Pool;
import alternativa.tanks.utils.objectpool.PooledObject;
import flash.display.BlendMode;
import flash.geom.Matrix3D;
import flash.geom.Vector3D;
public class LightningEffect extends PooledObject implements GraphicEffect {
public static const MID:Number = 14 / 60;
public static const END:Number = 50 / 60;
public static const TAIL:Number = 120 / 60;
private static const TARGET_Z_OFFSET:int = 20;
private static const SIZE:Number = 400;
private static const vector:Vector3D = new Vector3D();
private static const vector3:Vector3 = new Vector3();
private var container:Scene3DContainer;
private var target:Vector3;
private var lightningSound:Sound3D;
private var source:Object3D;
private var meshContainer:Object3DContainer;
private var mesh:Mesh;
private var time:Number;
private var lightingSoundPlayed:Boolean = false;
private var originOffset:Vector3D = new Vector3D();
public function LightningEffect(param1:Pool) {
super(param1);
this.meshContainer = new Object3DContainer();
this.mesh = new Mesh();
var local2:Vertex = this.mesh.addVertex(-SIZE / 2,0,SIZE,0,0);
var local3:Vertex = this.mesh.addVertex(-SIZE / 2,0,0,0,1);
var local4:Vertex = this.mesh.addVertex(SIZE / 2,0,0,1,1);
var local5:Vertex = this.mesh.addVertex(SIZE / 2,0,SIZE,1,0);
this.mesh.addQuadFace(local2,local3,local4,local5);
this.mesh.calculateFacesNormals();
this.mesh.calculateBounds();
this.mesh.useLight = false;
this.mesh.useShadowMap = false;
this.mesh.shadowMapAlphaThreshold = 2;
this.mesh.depthMapAlphaThreshold = 2;
this.mesh.blendMode = BlendMode.ADD;
this.mesh.softAttenuation = 20;
this.meshContainer.addChild(this.mesh);
}
public function init(param1:TextureMaterial, param2:Mesh, param3:Vector3, param4:Sound3D, param5:Number) : void {
this.source = param2;
this.target = param3;
this.lightningSound = param4;
this.mesh.setMaterialToAllFaces(param1);
this.originOffset.setTo(0,0,param5);
this.time = 0;
}
public function addedToScene(param1:Scene3DContainer) : void {
this.container = param1;
param1.addChild(this.meshContainer);
this.lightingSoundPlayed = false;
}
public function play(param1:int, param2:GameCamera) : Boolean {
var local3:Number = param1 / 1000;
this.time += local3;
this.turnToCamera(param2);
this.playSounds(param2);
if(this.time <= MID) {
this.mesh.alpha = this.time / MID;
return true;
}
if(this.time <= END) {
this.mesh.alpha = 1 - (this.time - MID) / (END - MID);
return true;
}
if(this.time <= TAIL) {
this.mesh.alpha = 0;
return true;
}
return false;
}
private function playSounds(param1:GameCamera) : void {
vector3.reset(this.target.x,this.target.y,this.target.z);
if(!this.lightingSoundPlayed) {
this.lightningSound.play(0,0);
this.lightningSound.checkVolume(param1.position,vector3,param1.xAxis);
this.lightingSoundPlayed = true;
}
}
private function turnToCamera(param1:GameCamera) : void {
var local2:Vector3D = null;
local2 = this.source.localToGlobal(this.originOffset);
this.meshContainer.x = local2.x;
this.meshContainer.y = local2.y;
this.meshContainer.z = local2.z;
vector.x = this.target.x - local2.x;
vector.y = this.target.y - local2.y;
vector.z = this.target.z + TARGET_Z_OFFSET - local2.z;
vector.scaleBy(0.9);
this.mesh.scaleZ = vector.length / SIZE;
this.meshContainer.rotationX = Math.atan2(vector.z,Math.sqrt(vector.x * vector.x + vector.y * vector.y)) - Math.PI / 2;
this.meshContainer.rotationY = 0;
this.meshContainer.rotationZ = -Math.atan2(vector.x,vector.y);
var local3:Matrix3D = this.meshContainer.concatenatedMatrix;
local3.invert();
local3.prepend(param1.concatenatedMatrix);
var local4:Vector3D = local3.transformVector(new Vector3D());
this.mesh.rotationZ = Math.atan2(local4.x,-local4.y);
}
public function destroy() : void {
this.container.removeChild(this.meshContainer);
this.mesh.setMaterialToAllFaces(null);
this.container = null;
if(this.lightningSound != null) {
this.lightningSound.stop();
this.lightningSound = null;
}
recycle();
}
public function kill() : void {
this.mesh.alpha = 0;
}
}
}
|
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.KillMessageOutputLine_rocketIconClass.png")]
public class KillMessageOutputLine_rocketIconClass extends BitmapAsset {
public function KillMessageOutputLine_rocketIconClass() {
super();
}
}
}
|
package alternativa.tanks.battle.objects.tank {
public interface LocalWeapon {
function pullTrigger() : void;
function releaseTrigger() : void;
}
}
|
package mx.core {
import flash.geom.Matrix;
import flash.geom.Matrix3D;
public interface IAssetLayoutFeatures {
function set layoutX(value:Number) : void;
function get layoutX() : Number;
function set layoutY(value:Number) : void;
function get layoutY() : Number;
function set layoutZ(value:Number) : void;
function get layoutZ() : Number;
function get layoutWidth() : Number;
function set layoutWidth(value:Number) : void;
function set transformX(value:Number) : void;
function get transformX() : Number;
function set transformY(value:Number) : void;
function get transformY() : Number;
function set transformZ(value:Number) : void;
function get transformZ() : Number;
function set layoutRotationX(value:Number) : void;
function get layoutRotationX() : Number;
function set layoutRotationY(value:Number) : void;
function get layoutRotationY() : Number;
function set layoutRotationZ(value:Number) : void;
function get layoutRotationZ() : Number;
function set layoutScaleX(value:Number) : void;
function get layoutScaleX() : Number;
function set layoutScaleY(value:Number) : void;
function get layoutScaleY() : Number;
function set layoutScaleZ(value:Number) : void;
function get layoutScaleZ() : Number;
function set layoutMatrix(value:Matrix) : void;
function get layoutMatrix() : Matrix;
function set layoutMatrix3D(value:Matrix3D) : void;
function get layoutMatrix3D() : Matrix3D;
function get is3D() : Boolean;
function get layoutIs3D() : Boolean;
function get mirror() : Boolean;
function set mirror(value:Boolean) : void;
function get stretchX() : Number;
function set stretchX(value:Number) : void;
function get stretchY() : Number;
function set stretchY(value:Number) : void;
function get computedMatrix() : Matrix;
function get computedMatrix3D() : Matrix3D;
}
}
|
package forms.ranks {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/forms.ranks.PremiumRankBitmaps_bitmapBigRank28.png")]
public class PremiumRankBitmaps_bitmapBigRank28 extends BitmapAsset {
public function PremiumRankBitmaps_bitmapBigRank28() {
super();
}
}
}
|
package alternativa.tanks.models.weapons.stream {
import alternativa.math.Vector3;
import alternativa.tanks.battle.BattleUtils;
import alternativa.tanks.battle.events.BattleEventDispatcher;
import alternativa.tanks.battle.events.StateCorrectionEvent;
import alternativa.tanks.battle.objects.tank.Tank;
import projects.tanks.client.battlefield.models.tankparts.weapons.common.TargetPosition;
import projects.tanks.client.battlefield.models.tankparts.weapons.common.discrete.TargetHit;
import projects.tanks.client.battlefield.models.tankparts.weapons.common.stream.IStreamWeaponCommunicationModelBase;
import projects.tanks.client.battlefield.models.tankparts.weapons.common.stream.StreamWeaponCommunicationModelBase;
import projects.tanks.client.battlefield.types.Vector3d;
[ModelInfo]
public class StreamWeaponCommunicationModel extends StreamWeaponCommunicationModelBase implements IStreamWeaponCommunicationModelBase, StreamWeaponCommunication {
[Inject]
public static var battleEventDispatcher:BattleEventDispatcher;
public function StreamWeaponCommunicationModel() {
super();
}
[Obfuscation(rename="false")]
public function startFire() : void {
this.streamWeaponListeners().onStart();
}
[Obfuscation(rename="false")]
public function stopFire() : void {
this.streamWeaponListeners().onStop();
}
[Obfuscation(rename="false")]
public function updateTargets(param1:Vector3d, param2:Vector.<TargetHit>) : void {
this.streamWeaponListeners().onTargetsUpdated(BattleUtils.getVector3(param1),param2);
}
public function fireStarted(param1:int) : void {
server.startFire(param1);
}
public function targetUpdate(param1:int, param2:Vector3, param3:Tank) : void {
this.targetsUpdated(param1,param2,this.asList(param3));
}
public function targetsUpdated(param1:int, param2:Vector3, param3:Vector.<TargetPosition>) : void {
battleEventDispatcher.dispatchEvent(StateCorrectionEvent.MANDATORY_UPDATE);
server.updateTargets(param1,BattleUtils.getVector3d(param2),param3);
}
public function targetsUpdateDummy(param1:int, param2:Vector3) : void {
battleEventDispatcher.dispatchEvent(StateCorrectionEvent.MANDATORY_UPDATE);
server.updateTargetsDummy(param1,BattleUtils.getVector3d(param2));
}
public function fireStopped(param1:int) : void {
server.stopFire(param1);
}
private function streamWeaponListeners() : StreamWeaponListener {
return StreamWeaponListener(object.event(StreamWeaponListener));
}
private function asList(param1:Tank) : Vector.<TargetPosition> {
var local2:Vector.<TargetPosition> = new Vector.<TargetPosition>();
if(param1 != null) {
local2.push(BattleUtils.getTargetPosition(param1));
}
return local2;
}
}
}
|
package alternativa.tanks.model.challenge.greenpanel.gray
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class GrayPacket_left_top extends BitmapAsset
{
public function GrayPacket_left_top()
{
super();
}
}
}
|
package projects.tanks.client.entrance.model.entrance.externalentrance {
public class ExternalEntranceCC {
private var _socialNetworkParams:Vector.<SocialNetworkEntranceParams>;
public function ExternalEntranceCC(param1:Vector.<SocialNetworkEntranceParams> = null) {
super();
this._socialNetworkParams = param1;
}
public function get socialNetworkParams() : Vector.<SocialNetworkEntranceParams> {
return this._socialNetworkParams;
}
public function set socialNetworkParams(param1:Vector.<SocialNetworkEntranceParams>) : void {
this._socialNetworkParams = param1;
}
public function toString() : String {
var local1:String = "ExternalEntranceCC [";
local1 += "socialNetworkParams = " + this.socialNetworkParams + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.models.battle.battlefield.keyboard {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.models.battle.battlefield.keyboard.DeviceIcons_minusfieldstabilizationIconClass.png")]
public class DeviceIcons_minusfieldstabilizationIconClass extends BitmapAsset {
public function DeviceIcons_minusfieldstabilizationIconClass() {
super();
}
}
}
|
package alternativa.tanks.gui.category {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.category.ItemCategoryButton_specialIconClass.png")]
public class ItemCategoryButton_specialIconClass extends BitmapAsset {
public function ItemCategoryButton_specialIconClass() {
super();
}
}
}
|
package controls.scroller.green
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class ScrollSkinGreen_thumbMiddle extends BitmapAsset
{
public function ScrollSkinGreen_thumbMiddle()
{
super();
}
}
}
|
package platform.client.models.commons.periodtime {
public interface ITimePeriodModelBase {
}
}
|
package controls.rangicons
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class RangIcon_p19 extends BitmapAsset
{
public function RangIcon_p19()
{
super();
}
}
}
|
package projects.tanks.client.panel.model.rulesupdate.showing {
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 RulesUpdateShowingModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:RulesUpdateShowingModelServer;
private var client:IRulesUpdateShowingModelBase = IRulesUpdateShowingModelBase(this);
private var modelId:Long = Long.getLong(339112017,194970316);
public function RulesUpdateShowingModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new RulesUpdateShowingModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(RulesUpdateShowingCC,false)));
}
protected function getInitParam() : RulesUpdateShowingCC {
return RulesUpdateShowingCC(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 assets.slider {
import flash.display.BitmapData;
[Embed(source="/_assets/assets.slider.slider_THUMB_RIGHT.png")]
public dynamic class slider_THUMB_RIGHT extends BitmapData {
public function slider_THUMB_RIGHT(param1:int = 10, param2:int = 30) {
super(param1,param2);
}
}
}
|
package alternativa.tanks.model.banner
{
import alternativa.object.ClientObject;
import flash.display.BitmapData;
public interface IBanner
{
function getBannerBd(param1:ClientObject) : BitmapData;
function getBannerURL(param1:ClientObject) : String;
function click(param1:ClientObject) : void;
}
}
|
package _codec.projects.tanks.client.achievements.model {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import projects.tanks.client.achievements.model.Achievement;
public class CodecAchievement implements ICodec {
public function CodecAchievement() {
super();
}
public function init(param1:IProtocol) : void {
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:Achievement = null;
var local3:int = int(param1.reader.readInt());
switch(local3) {
case 0:
local2 = Achievement.FIRST_PURCHASE;
break;
case 1:
local2 = Achievement.FIGHT_FIRST_BATTLE;
break;
case 2:
local2 = Achievement.FIRST_REFERRAL;
}
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 com.alternativaplatform.projects.tanks.client.commons.types
{
public class TankParts
{
public var hullObjectId:String;
public var turretObjectId:String;
public var coloringObjectId:String;
public function TankParts()
{
super();
}
}
}
|
package alternativa.tanks.models.battle.gui.chat {
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class IBattleChatEvents implements IBattleChat {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function IBattleChatEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function getChat() : BattleChat {
var result:BattleChat = null;
var i:int = 0;
var m:IBattleChat = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = IBattleChat(this.impl[i]);
result = m.getChat();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
}
}
|
package projects.tanks.client.battlefield.models.tankparts.armor.common {
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 HullCommonModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:HullCommonModelServer;
private var client:IHullCommonModelBase = IHullCommonModelBase(this);
private var modelId:Long = Long.getLong(2136429398,-1896774533);
public function HullCommonModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new HullCommonModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(HullCommonCC,false)));
}
protected function getInitParam() : HullCommonCC {
return HullCommonCC(initParams[Model.object]);
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
var local3:* = param1;
switch(false ? 0 : 0) {
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package alternativa.tanks.models.tank.device {
import alternativa.types.Long;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class TankDeviceEvents implements TankDevice {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function TankDeviceEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function getDevice() : Long {
var result:Long = null;
var i:int = 0;
var m:TankDevice = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = TankDevice(this.impl[i]);
result = m.getDevice();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
}
}
|
package alternativa.tanks.sfx
{
import alternativa.engine3d.core.Object3D;
import alternativa.math.Vector3;
import alternativa.tanks.camera.GameCamera;
import alternativa.tanks.utils.objectpool.ObjectPool;
import alternativa.tanks.utils.objectpool.PooledObject;
public class ScalingObject3DPositionProvider extends PooledObject implements Object3DPositionProvider
{
private var initialPosition:Vector3;
private var velocity:Vector3;
private var scaleVelocity:Number;
public function ScalingObject3DPositionProvider(param1:ObjectPool)
{
this.initialPosition = new Vector3();
this.velocity = new Vector3();
super(param1);
}
public function initPosition(param1:Object3D) : void
{
param1.x = this.initialPosition.x;
param1.y = this.initialPosition.y;
param1.z = this.initialPosition.z;
param1.scaleX = 1;
param1.scaleY = 1;
param1.scaleZ = 1;
}
public function init(param1:Vector3, param2:Vector3, param3:Number) : void
{
this.initialPosition.vCopy(param1);
this.velocity.vCopy(param2);
this.scaleVelocity = param3;
}
public function updateObjectPosition(param1:Object3D, param2:GameCamera, param3:int) : void
{
var _loc4_:Number = 0.001 * param3;
param1.x += this.velocity.x * _loc4_;
param1.y += this.velocity.y * _loc4_;
param1.z += this.velocity.z * _loc4_;
param1.scaleX += this.scaleVelocity;
param1.scaleY += this.scaleVelocity;
param1.scaleZ += this.scaleVelocity;
}
public function destroy() : void
{
}
}
}
|
package alternativa.tanks.engine3d {
import alternativa.engine3d.materials.Material;
import alternativa.engine3d.objects.Sprite3D;
public class AnimatedSprite3D extends Sprite3D {
public var looped:Boolean;
private var uvFrames:Vector.<UVFrame>;
private var numFrames:int;
private var fps:Number;
private var currentFrame:Number = 0;
public function AnimatedSprite3D(param1:Number, param2:Number, param3:Material = null) {
super(param1,param2,param3);
useShadowMap = false;
useLight = false;
}
public function setAnimationData(param1:TextureAnimation) : void {
material = param1.material;
this.uvFrames = param1.frames;
this.fps = param1.fps;
this.numFrames = this.uvFrames.length;
this.currentFrame = 0;
this.setFrameIndex(this.currentFrame);
}
public function getFps() : Number {
return this.fps;
}
public function getNumFrames() : int {
return this.numFrames;
}
public function clear() : void {
this.uvFrames = null;
material = null;
this.numFrames = 0;
}
public function setFrameIndex(param1:int) : void {
var local2:int = param1 % this.numFrames;
this.setFrame(this.uvFrames[local2]);
}
private function setFrame(param1:UVFrame) : void {
topLeftU = param1.topLeftU;
topLeftV = param1.topLeftV;
bottomRightU = param1.bottomRightU;
bottomRightV = param1.bottomRightV;
}
public function update(param1:Number) : void {
this.currentFrame += this.fps * param1;
if(this.currentFrame >= this.numFrames) {
if(this.looped) {
this.currentFrame %= this.numFrames;
} else {
this.currentFrame = this.numFrames - 1;
}
}
this.setFrame(this.uvFrames[int(this.currentFrame)]);
}
}
}
|
package forms.ranks {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/forms.ranks.PremiumRankBitmaps_bitmapSmallRank15.png")]
public class PremiumRankBitmaps_bitmapSmallRank15 extends BitmapAsset {
public function PremiumRankBitmaps_bitmapSmallRank15() {
super();
}
}
}
|
package com.hurlant.crypto.tls {
import alternativa.osgi.service.clientlog.IClientLog;
import com.hurlant.crypto.cert.X509Certificate;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.SecurityErrorEvent;
import flash.net.ObjectEncoding;
import flash.net.Socket;
import flash.system.Security;
import flash.utils.ByteArray;
import flash.utils.Endian;
import flash.utils.IDataInput;
import flash.utils.IDataOutput;
import flash.utils.clearTimeout;
import flash.utils.setTimeout;
[Event(name="acceptPeerCertificatePrompt",type="flash.events.Event")]
[Event(name="socketData",type="flash.events.ProgressEvent")]
[Event(name="securityError",type="flash.events.SecurityErrorEvent")]
[Event(name="ioError",type="flash.events.IOErrorEvent")]
[Event(name="connect",type="flash.events.Event")]
[Event(name="close",type="flash.events.Event")]
public class TLSSocket extends Socket implements IDataInput, IDataOutput {
[Inject]
public static var clientLog:IClientLog;
public static const LOG_CHANNEL:String = "tlsengine";
public static const ACCEPT_PEER_CERT_PROMPT:String = "acceptPeerCertificatePrompt";
private var _endian:String;
private var _objectEncoding:uint;
private var _iStream:ByteArray;
private var _oStream:ByteArray;
private var _iStream_cursor:uint;
private var _socket:Socket;
private var _config:TLSConfig;
private var _engine:TLSEngine;
private var _ready:Boolean;
private var _writeScheduler:uint;
public function TLSSocket(param1:String = null, param2:int = 0, param3:TLSConfig = null) {
super();
this._config = param3;
if(param1 != null && param2 != 0) {
this.connect(param1,param2);
}
}
override public function get bytesAvailable() : uint {
return this._iStream.bytesAvailable;
}
override public function get connected() : Boolean {
return this._socket.connected;
}
override public function get endian() : String {
return this._endian;
}
override public function set endian(param1:String) : void {
this._endian = param1;
this._iStream.endian = param1;
this._oStream.endian = param1;
}
override public function get objectEncoding() : uint {
return this._objectEncoding;
}
override public function set objectEncoding(param1:uint) : void {
this._objectEncoding = param1;
this._iStream.objectEncoding = param1;
this._oStream.objectEncoding = param1;
}
private function onTLSData(param1:TLSEvent) : void {
if(this._iStream.position == this._iStream.length) {
this._iStream.position = 0;
this._iStream.length = 0;
this._iStream_cursor = 0;
}
var local2:uint = this._iStream.position;
this._iStream.position = this._iStream_cursor;
this._iStream.writeBytes(param1.data);
this._iStream_cursor = this._iStream.position;
this._iStream.position = local2;
dispatchEvent(new ProgressEvent(ProgressEvent.SOCKET_DATA,false,false,param1.data.length));
}
private function onTLSReady(param1:TLSEvent) : void {
this._ready = true;
this.scheduleWrite();
}
private function onTLSClose(param1:Event) : void {
dispatchEvent(param1);
this.close();
}
private function scheduleWrite() : void {
if(this._writeScheduler != 0) {
return;
}
this._writeScheduler = setTimeout(this.commitWrite,0);
}
private function commitWrite() : void {
clearTimeout(this._writeScheduler);
this._writeScheduler = 0;
if(this._ready) {
this._engine.sendApplicationData(this._oStream);
this._oStream.length = 0;
}
}
override public function close() : void {
this._ready = false;
this._engine.close();
if(this._socket.connected) {
this._socket.flush();
this._socket.close();
}
}
public function setTLSConfig(param1:TLSConfig) : void {
this._config = param1;
}
override public function connect(param1:String, param2:int) : void {
Security.allowDomain("*");
Security.loadPolicyFile("http://" + param1 + "/crossdomain.xml");
this.init(new Socket(),this._config,param1);
this._socket.connect(param1,param2);
}
public function releaseSocket() : void {
this._socket.removeEventListener(Event.CONNECT,dispatchEvent);
this._socket.removeEventListener(IOErrorEvent.IO_ERROR,dispatchEvent);
this._socket.removeEventListener(SecurityErrorEvent.SECURITY_ERROR,dispatchEvent);
this._socket.removeEventListener(Event.CLOSE,dispatchEvent);
this._socket.removeEventListener(ProgressEvent.SOCKET_DATA,this._engine.dataAvailable);
this._socket = null;
}
public function reinitialize(param1:String, param2:TLSConfig) : void {
var host:String = param1;
var config:TLSConfig = param2;
var ba:ByteArray = new ByteArray();
if(this._socket.bytesAvailable > 0) {
this._socket.readBytes(ba,0,this._socket.bytesAvailable);
}
this._iStream = new ByteArray();
this._oStream = new ByteArray();
this._iStream_cursor = 0;
this.objectEncoding = ObjectEncoding.DEFAULT;
this.endian = Endian.BIG_ENDIAN;
if(config == null) {
config = new TLSConfig(TLSEngine.CLIENT);
}
this._engine = new TLSEngine(config,this._socket,this._socket,host);
this._engine.addEventListener(TLSEvent.DATA,this.onTLSData);
this._engine.addEventListener(TLSEvent.READY,this.onTLSReady);
this._engine.addEventListener(Event.CLOSE,this.onTLSClose);
this._engine.addEventListener(ProgressEvent.SOCKET_DATA,function(param1:*):void {
_socket.flush();
});
this._socket.addEventListener(ProgressEvent.SOCKET_DATA,this._engine.dataAvailable);
this._engine.addEventListener(TLSEvent.PROMPT_ACCEPT_CERT,this.onAcceptCert);
this._ready = false;
this._engine.start();
}
public function startTLS(param1:Socket, param2:String, param3:TLSConfig = null) : void {
if(!param1.connected) {
throw new Error("Cannot STARTTLS on a socket that isn\'t connected.");
}
this.init(param1,param3,param2);
}
private function init(param1:Socket, param2:TLSConfig, param3:String) : void {
var socket:Socket = param1;
var config:TLSConfig = param2;
var host:String = param3;
this._iStream = new ByteArray();
this._oStream = new ByteArray();
this._iStream_cursor = 0;
this.objectEncoding = ObjectEncoding.DEFAULT;
this.endian = Endian.BIG_ENDIAN;
this._socket = socket;
this._socket.addEventListener(Event.CONNECT,dispatchEvent);
this._socket.addEventListener(Event.CONNECT,this.onSocketConnected);
this._socket.addEventListener(IOErrorEvent.IO_ERROR,dispatchEvent);
this._socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR,dispatchEvent);
this._socket.addEventListener(Event.CLOSE,dispatchEvent);
if(config == null) {
config = new TLSConfig(TLSEngine.CLIENT);
}
this._engine = new TLSEngine(config,this._socket,this._socket,host);
this._engine.addEventListener(TLSEvent.DATA,this.onTLSData);
this._engine.addEventListener(TLSEvent.PROMPT_ACCEPT_CERT,this.onAcceptCert);
this._engine.addEventListener(TLSEvent.READY,this.onTLSReady);
this._engine.addEventListener(Event.CLOSE,this.onTLSClose);
this._engine.addEventListener(ProgressEvent.SOCKET_DATA,function(param1:*):void {
if(connected) {
_socket.flush();
}
});
this._socket.addEventListener(ProgressEvent.SOCKET_DATA,this._engine.dataAvailable);
this._ready = false;
}
private function onSocketConnected(param1:Event) : void {
this._engine.start();
this.dispatchEvent(param1);
}
override public function flush() : void {
this.commitWrite();
this._socket.flush();
}
override public function readBoolean() : Boolean {
return this._iStream.readBoolean();
}
override public function readByte() : int {
return this._iStream.readByte();
}
override public function readBytes(param1:ByteArray, param2:uint = 0, param3:uint = 0) : void {
this._iStream.readBytes(param1,param2,param3);
}
override public function readDouble() : Number {
return this._iStream.readDouble();
}
override public function readFloat() : Number {
return this._iStream.readFloat();
}
override public function readInt() : int {
return this._iStream.readInt();
}
override public function readMultiByte(param1:uint, param2:String) : String {
return this._iStream.readMultiByte(param1,param2);
}
override public function readObject() : * {
return this._iStream.readObject();
}
override public function readShort() : int {
return this._iStream.readShort();
}
override public function readUnsignedByte() : uint {
return this._iStream.readUnsignedByte();
}
override public function readUnsignedInt() : uint {
return this._iStream.readUnsignedInt();
}
override public function readUnsignedShort() : uint {
return this._iStream.readUnsignedShort();
}
override public function readUTF() : String {
return this._iStream.readUTF();
}
override public function readUTFBytes(param1:uint) : String {
return this._iStream.readUTFBytes(param1);
}
override public function writeBoolean(param1:Boolean) : void {
this._oStream.writeBoolean(param1);
this.scheduleWrite();
}
override public function writeByte(param1:int) : void {
this._oStream.writeByte(param1);
this.scheduleWrite();
}
override public function writeBytes(param1:ByteArray, param2:uint = 0, param3:uint = 0) : void {
this._oStream.writeBytes(param1,param2,param3);
this.scheduleWrite();
}
override public function writeDouble(param1:Number) : void {
this._oStream.writeDouble(param1);
this.scheduleWrite();
}
override public function writeFloat(param1:Number) : void {
this._oStream.writeFloat(param1);
this.scheduleWrite();
}
override public function writeInt(param1:int) : void {
this._oStream.writeInt(param1);
this.scheduleWrite();
}
override public function writeMultiByte(param1:String, param2:String) : void {
this._oStream.writeMultiByte(param1,param2);
this.scheduleWrite();
}
override public function writeObject(param1:*) : void {
this._oStream.writeObject(param1);
this.scheduleWrite();
}
override public function writeShort(param1:int) : void {
this._oStream.writeShort(param1);
this.scheduleWrite();
}
override public function writeUnsignedInt(param1:uint) : void {
this._oStream.writeUnsignedInt(param1);
this.scheduleWrite();
}
override public function writeUTF(param1:String) : void {
this._oStream.writeUTF(param1);
this.scheduleWrite();
}
override public function writeUTFBytes(param1:String) : void {
this._oStream.writeUTFBytes(param1);
this.scheduleWrite();
}
public function getPeerCertificate() : X509Certificate {
return this._engine.peerCertificate;
}
public function onAcceptCert(param1:TLSEvent) : void {
dispatchEvent(new TLSSocketEvent(this._engine.peerCertificate));
}
public function acceptPeerCertificate(param1:Event) : void {
this._engine.acceptPeerCertificate();
}
public function rejectPeerCertificate(param1:Event) : void {
this._engine.rejectPeerCertificate();
}
}
}
|
package _codec.projects.tanks.client.garage.models.item.properties {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.EnumCodecInfo;
import projects.tanks.client.garage.models.item.properties.ItemProperty;
public class VectorCodecItemPropertyLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecItemPropertyLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new EnumCodecInfo(ItemProperty,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.<ItemProperty> = new Vector.<ItemProperty>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = ItemProperty(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:ItemProperty = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<ItemProperty> = Vector.<ItemProperty>(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.garage.resistance {
import projects.tanks.client.commons.types.ItemGarageProperty;
[ModelInterface]
public interface ModuleResistances {
function getResistances() : Vector.<ItemGarageProperty>;
}
}
|
package alternativa.tanks.model.emailreminder {
[ModelInterface]
public interface EmailReminderService {
function showEmailReminder() : void;
function showNeedEmailAlert() : void;
}
}
|
package alternativa.engine3d.loaders.collada {
import alternativa.engine3d.animation.keys.NumberTrack;
import alternativa.engine3d.animation.keys.Track;
import alternativa.engine3d.animation.keys.TransformTrack;
import flash.geom.Matrix3D;
use namespace collada;
public class DaeSampler extends DaeElement {
private var times:Vector.<Number>;
private var values:Vector.<Number>;
private var timesStride:int;
private var valuesStride:int;
public function DaeSampler(param1:XML, param2:DaeDocument) {
super(param1,param2);
}
override protected function parseImplementation() : Boolean {
var local2:DaeSource = null;
var local3:DaeSource = null;
var local6:DaeInput = null;
var local7:String = null;
var local1:XMLList = data.input;
var local4:int = 0;
var local5:int = int(local1.length());
for(; local4 < local5; local4++) {
local6 = new DaeInput(local1[local4],document);
local7 = local6.semantic;
if(local7 == null) {
continue;
}
switch(local7) {
case "INPUT":
local2 = local6.prepareSource(1);
if(local2 != null) {
this.times = local2.numbers;
this.timesStride = local2.stride;
}
break;
case "OUTPUT":
local3 = local6.prepareSource(1);
if(local3 != null) {
this.values = local3.numbers;
this.valuesStride = local3.stride;
}
break;
}
}
return true;
}
public function parseNumbersTrack(param1:String, param2:String) : NumberTrack {
var local3:NumberTrack = null;
var local4:int = 0;
var local5:int = 0;
if(this.times != null && this.values != null && this.timesStride > 0) {
local3 = new NumberTrack(param1,param2);
local4 = this.times.length / this.timesStride;
local5 = 0;
while(local5 < local4) {
local3.addKey(this.times[int(this.timesStride * local5)],this.values[int(this.valuesStride * local5)]);
local5++;
}
return local3;
}
return null;
}
public function parseTransformationTrack(param1:String) : Track {
var local2:TransformTrack = null;
var local3:int = 0;
var local4:int = 0;
var local5:int = 0;
var local6:Matrix3D = null;
if(this.times != null && this.values != null && this.timesStride != 0) {
local2 = new TransformTrack(param1);
local3 = this.times.length / this.timesStride;
local4 = 0;
while(local4 < local3) {
local5 = this.valuesStride * local4;
local6 = new Matrix3D(Vector.<Number>([this.values[local5],this.values[local5 + 4],this.values[local5 + 8],this.values[local5 + 12],this.values[local5 + 1],this.values[local5 + 5],this.values[local5 + 9],this.values[local5 + 13],this.values[local5 + 2],this.values[local5 + 6],this.values[local5 + 10],this.values[local5 + 14],this.values[local5 + 3],this.values[local5 + 7],this.values[local5 + 11],this.values[local5 + 15]]));
local2.addKey(this.times[local4 * this.timesStride],local6);
local4++;
}
return local2;
}
return null;
}
public function parsePointsTracks(param1:String, param2:String, param3:String, param4:String) : Vector.<Track> {
var local5:NumberTrack = null;
var local6:NumberTrack = null;
var local7:NumberTrack = null;
var local8:int = 0;
var local9:int = 0;
var local10:int = 0;
var local11:Number = NaN;
if(this.times != null && this.values != null && this.timesStride != 0) {
local5 = new NumberTrack(param1,param2);
local5.object = param1;
local6 = new NumberTrack(param1,param3);
local6.object = param1;
local7 = new NumberTrack(param1,param4);
local7.object = param1;
local8 = this.times.length / this.timesStride;
local9 = 0;
while(local9 < local8) {
local10 = local9 * this.valuesStride;
local11 = this.times[local9 * this.timesStride];
local5.addKey(local11,this.values[local10]);
local6.addKey(local11,this.values[local10 + 1]);
local7.addKey(local11,this.values[local10 + 2]);
local9++;
}
return Vector.<Track>([local5,local6,local7]);
}
return null;
}
}
}
|
package _codec.projects.tanks.client.clans.panel.loadingclan {
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.clans.panel.loadingclan.ClanLoadingPanelCC;
public class CodecClanLoadingPanelCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_clanButtonVisible:ICodec;
private var codec_minRankForCreateClan:ICodec;
public function CodecClanLoadingPanelCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_clanButtonVisible = param1.getCodec(new TypeCodecInfo(Boolean,false));
this.codec_minRankForCreateClan = param1.getCodec(new TypeCodecInfo(int,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:ClanLoadingPanelCC = new ClanLoadingPanelCC();
local2.clanButtonVisible = this.codec_clanButtonVisible.decode(param1) as Boolean;
local2.minRankForCreateClan = this.codec_minRankForCreateClan.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:ClanLoadingPanelCC = ClanLoadingPanelCC(param2);
this.codec_clanButtonVisible.encode(param1,local3.clanButtonVisible);
this.codec_minRankForCreateClan.encode(param1,local3.minRankForCreateClan);
}
}
}
|
package alternativa.tanks.gui
{
import alternativa.init.Main;
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.locale.constants.TextConst;
import controls.BlueButton;
import controls.Label;
import controls.RedButton;
import controls.TankInput;
import controls.TankWindow;
import controls.TankWindowHeader;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.FocusEvent;
import flash.events.MouseEvent;
import flash.geom.Point;
public class ChangeEmailAndPasswordWindow extends Sprite
{
private var windowSize:Point;
private var window:TankWindow;
private var passwordInput:TankInput;
private var passwordConfirmInput:TankInput;
private var emailInput:TankInput;
private var passLabel:Label;
private var passConfirmLabel:Label;
private var emailLabel:Label;
private var localeService:ILocaleService;
private var okButton:BlueButton;
private var cancelButton:RedButton;
private const windowMargin:int = 12;
private const margin:int = 9;
private const buttonSize:Point = new Point(104,33);
public function ChangeEmailAndPasswordWindow()
{
super();
this.localeService = ILocaleService(Main.osgi.getService(ILocaleService));
this.initGUI();
this.initEvents();
}
public function get password() : String
{
if(this.passwordConfirmInput.validValue)
{
return this.passwordInput.value;
}
return null;
}
public function get passwordRepeate() : String
{
if(this.passwordConfirmInput.validValue)
{
return this.passwordConfirmInput.value;
}
return null;
}
public function get email() : String
{
if(this.emailInput.validValue)
{
return this.emailInput.value;
}
return null;
}
public function set email(value:String) : void
{
this.emailInput.value = value;
}
private function initGUI() : void
{
this.windowSize = new Point(440,190);
this.window = new TankWindow(this.windowSize.x,this.windowSize.y);
this.window.headerLang = this.localeService.getText(TextConst.GUI_LANG);
this.window.header = TankWindowHeader.CHANGEPASSWORD;
addChild(this.window);
this.passwordInput = new TankInput();
this.passwordInput.hidden = true;
this.passwordInput.width = 120;
this.passwordInput.x = 109;
this.passwordInput.y = 35 + this.margin;
addChild(this.passwordInput);
this.passLabel = new Label();
this.passLabel.text = this.localeService.getText(TextConst.SETTINGS_NEW_PASSWORD_LABEL_TEXT);
this.passLabel.x = 109 - this.margin - this.passLabel.textWidth;
this.passLabel.y = this.passwordInput.y + Math.round((this.passwordInput.height - this.passLabel.textHeight) * 0.5) - 2;
addChild(this.passLabel);
this.passConfirmLabel = new Label();
this.passConfirmLabel.text = this.localeService.getText(TextConst.SETTINGS_REENTER_PASSWORD_LABEL_TEXT);
this.passConfirmLabel.x = this.passwordInput.x + this.passwordInput.width + 7;
this.passConfirmLabel.y = this.passLabel.y;
addChild(this.passConfirmLabel);
this.passwordConfirmInput = new TankInput();
this.passwordConfirmInput.width = 120;
this.passwordConfirmInput.hidden = true;
this.passwordConfirmInput.x = this.passConfirmLabel.x + this.passConfirmLabel.textWidth + this.margin;
this.passwordConfirmInput.y = this.passwordInput.y;
addChild(this.passwordConfirmInput);
this.emailLabel = new Label();
this.emailLabel.text = this.localeService.getText(TextConst.SETTINGS_EMAIL_LABEL_TEXT);
this.emailLabel.x = this.passLabel.x;
this.emailLabel.y = this.passwordConfirmInput.y + this.passwordConfirmInput.height + this.windowMargin + 6;
addChild(this.emailLabel);
this.emailInput = new TankInput();
this.emailInput.x = this.emailLabel.x + this.emailLabel.textWidth + this.margin;
this.emailInput.y = this.passwordConfirmInput.y + this.passwordConfirmInput.height + this.windowMargin;
this.emailInput.width = this.windowSize.x - this.margin - this.emailInput.x - 8;
addChild(this.emailInput);
this.okButton = new BlueButton();
this.okButton.label = this.localeService.getText(TextConst.SETTINGS_BUTTON_SAVE_TEXT);
this.okButton.x = this.windowSize.x - this.buttonSize.x - this.margin - 3;
this.okButton.y = this.windowSize.y - this.buttonSize.y - this.margin;
this.okButton.enable = false;
addChild(this.okButton);
this.cancelButton = new RedButton();
this.cancelButton.label = this.localeService.getText(TextConst.SETTINGS_BUTTON_CANCEL_TEXT);
this.cancelButton.x = this.windowSize.x - this.buttonSize.x * 2 - 5 - this.margin;
this.cancelButton.y = this.windowSize.y - this.buttonSize.y - this.margin;
addChild(this.cancelButton);
}
private function initEvents() : void
{
this.passwordInput.addEventListener(FocusEvent.FOCUS_OUT,this.checkPasswordConfirmation);
this.passwordInput.addEventListener(FocusEvent.FOCUS_IN,this.restoreInput);
this.passwordConfirmInput.addEventListener(FocusEvent.FOCUS_OUT,this.checkPasswordConfirmation);
this.passwordConfirmInput.addEventListener(FocusEvent.FOCUS_IN,this.restoreInput);
this.emailInput.addEventListener(FocusEvent.FOCUS_OUT,this.validateEmail);
this.emailInput.addEventListener(FocusEvent.FOCUS_IN,this.restoreInput);
this.okButton.addEventListener(MouseEvent.CLICK,this.onOkClick);
this.cancelButton.addEventListener(MouseEvent.CLICK,this.onCancelClick);
}
private function onOkClick(e:MouseEvent) : void
{
dispatchEvent(new ChangePasswordAndEmailEvent(ChangePasswordAndEmailEvent.CHANGE_PRESSED));
}
private function onCancelClick(event:MouseEvent) : void
{
dispatchEvent(new ChangePasswordAndEmailEvent(ChangePasswordAndEmailEvent.CANCEL_PRESSED));
}
private function checkPasswordConfirmation(e:Event) : void
{
if(this.passwordInput.value.length > 0 && this.passwordConfirmInput.value != this.passwordInput.value)
{
this.passwordConfirmInput.validValue = false;
}
else
{
this.passwordConfirmInput.validValue = true;
}
this.switchChangeButton();
}
private function validateEmail(event:FocusEvent) : void
{
var pattern:RegExp = /(\w|[_.\-])+@((\w|-)+\.)+\w{2,4}+/;
var result:Object = pattern.exec(this.emailInput.value);
if(this.emailInput.value.length > 0)
{
this.emailInput.validValue = result != null;
}
else
{
this.emailInput.validValue = false;
}
this.switchChangeButton();
}
private function restoreInput(e:Event) : void
{
var trgt:TankInput = e.currentTarget as TankInput;
trgt.validValue = true;
}
private function switchChangeButton() : void
{
this.okButton.enable = this.passwordConfirmInput.validValue && this.emailInput.validValue;
}
}
}
|
package alternativa.protocol
{
import alternativa.init.ProtocolActivator;
import alternativa.osgi.service.console.IConsoleService;
import flash.utils.ByteArray;
import flash.utils.IDataInput;
import flash.utils.IDataOutput;
public class Packet
{
private static const ZIP_PACKET_SIZE_DELIMITER:int = 2000;
private static const MAXIMUM_DATA_LENGTH:int = 2147483647;
private static const LONG_SIZE_DELIMITER:int = 16384;
private static const ZIPPED_FLAG:int = int(64);
private static const LENGTH_FLAG:int = int(128);
public function Packet()
{
super();
}
private function wrap(src:IDataInput, dst:IDataOutput, zipped:Boolean) : void
{
var sizeToWrite:int = 0;
var hiByte:int = 0;
var loByte:int = 0;
var toWrap:ByteArray = new ByteArray();
while(src.bytesAvailable)
{
toWrap.writeByte(src.readByte());
}
toWrap.position = 0;
var longSize:Boolean = this.isLongSize(toWrap);
if(!zipped && longSize)
{
zipped = true;
}
if(zipped)
{
toWrap.compress();
}
var length:int = toWrap.length;
if(length > MAXIMUM_DATA_LENGTH)
{
throw new Error("Packet size too big(" + length + ")");
}
if(longSize)
{
sizeToWrite = length + (LENGTH_FLAG << 24);
dst.writeInt(sizeToWrite);
}
else
{
hiByte = int(((length & 65280) >> 8) + (!!zipped ? ZIPPED_FLAG : 0));
loByte = int(length & 255);
dst.writeByte(hiByte);
dst.writeByte(loByte);
}
dst.writeBytes(toWrap,0,length);
}
public function wrapPacket(src:IDataInput, dst:IDataOutput) : void
{
this.wrap(src,dst,this.determineZipped(src));
}
public function wrapZippedPacket(src:IDataInput, dst:IDataOutput) : void
{
this.wrap(src,dst,true);
}
public function wrapUnzippedPacket(src:IDataInput, dst:IDataOutput) : void
{
this.wrap(src,dst,false);
}
public function unwrapPacket(src:IDataInput, dst:IDataOutput) : Boolean
{
var flagByte:int = 0;
var longSize:Boolean = false;
var isZipped:Boolean = false;
var packetSize:int = 0;
var readPacket:Boolean = false;
var hiByte:int = 0;
var middleByte:int = 0;
var loByte:int = 0;
var loByte2:int = 0;
var toUnwrap:ByteArray = null;
var i:int = 0;
var console:IConsoleService = null;
var s:String = null;
var b:String = null;
var result:Boolean = false;
if(src.bytesAvailable >= 2)
{
flagByte = src.readByte();
longSize = (flagByte & LENGTH_FLAG) != 0;
readPacket = true;
if(src.bytesAvailable >= 1)
{
if(longSize)
{
if(src.bytesAvailable >= 3)
{
isZipped = true;
hiByte = (flagByte ^ LENGTH_FLAG) << 24;
middleByte = (src.readByte() & 255) << 16;
loByte = (src.readByte() & 255) << 8;
loByte2 = src.readByte() & 255;
packetSize = hiByte + middleByte + loByte + loByte2;
}
else
{
readPacket = false;
}
}
else
{
isZipped = (flagByte & ZIPPED_FLAG) != 0;
hiByte = (flagByte & 63) << 8;
loByte = src.readByte() & 255;
packetSize = hiByte + loByte;
}
if(src.bytesAvailable < packetSize)
{
readPacket = false;
}
if(readPacket)
{
toUnwrap = new ByteArray();
for(i = 0; i < packetSize; i++)
{
toUnwrap.writeByte(src.readByte());
}
if(isZipped)
{
toUnwrap.uncompress();
}
console = ProtocolActivator.osgi.getService(IConsoleService) as IConsoleService;
s = "Unwraped data: ";
toUnwrap.position = 0;
while(toUnwrap.bytesAvailable)
{
b = toUnwrap.readUnsignedByte().toString(16).toUpperCase() + " ";
if(b.length < 3)
{
b = "0" + b;
}
s += b;
}
console.writeToConsoleChannel("PROTOCOL",s);
toUnwrap.position = 0;
dst.writeBytes(toUnwrap,0,toUnwrap.length);
result = true;
}
}
}
return result;
}
private function isLongSize(reader:IDataInput) : Boolean
{
return reader.bytesAvailable >= LONG_SIZE_DELIMITER || reader.bytesAvailable == -1;
}
private function determineZipped(reader:IDataInput) : Boolean
{
return reader.bytesAvailable == -1 || reader.bytesAvailable > ZIP_PACKET_SIZE_DELIMITER;
}
}
}
|
package projects.tanks.client.garage.models.item.delaymount {
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 DelayMountCategoryModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:DelayMountCategoryModelServer;
private var client:IDelayMountCategoryModelBase = IDelayMountCategoryModelBase(this);
private var modelId:Long = Long.getLong(1655340370,1523265001);
public function DelayMountCategoryModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new DelayMountCategoryModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(DelayMountCategoryCC,false)));
}
protected function getInitParam() : DelayMountCategoryCC {
return DelayMountCategoryCC(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;
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.