code
stringlengths 57
237k
|
|---|
package _codec.projects.tanks.client.panel.model.payment.modes.qiwi {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.panel.model.payment.modes.qiwi.QiwiPaymentCC;
public class VectorCodecQiwiPaymentCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecQiwiPaymentCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(QiwiPaymentCC,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.<QiwiPaymentCC> = new Vector.<QiwiPaymentCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = QiwiPaymentCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:QiwiPaymentCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<QiwiPaymentCC> = Vector.<QiwiPaymentCC>(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.gui.payment.forms.leogaming {
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.gui.payment.controls.ProceedButton;
import alternativa.tanks.gui.payment.forms.PayModeForm;
import alternativa.tanks.gui.payment.forms.paymentstatus.PaymentStatusForm;
import alternativa.tanks.model.payment.modes.leogaming.LeogamingPaymentMode;
import flash.events.Event;
import flash.events.MouseEvent;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.clients.fp10.libraries.TanksLocale;
public class LeogamingMobileForm extends PayModeForm {
[Inject]
public static var localeService:ILocaleService;
private static const PROCEED_BUTTON_WIDTH:int = 100;
private static const MARGIN:int = 20;
private var phoneForm:LeogamingPhoneForm;
private var codeConfirmForm:LeogamingCodeConfirmForm;
private var proceedButton:ProceedButton;
private var statusForm:PaymentStatusForm;
private var state:LeogamingPhonePaymentState = LeogamingPhonePaymentState.PHONE;
public function LeogamingMobileForm(param1:IGameObject) {
super(param1);
this.addPhoneForm();
this.addCodeConfirmCode();
this.addProceedButton();
this.addStatus();
this.render();
this.setEvents();
}
private function addStatus() : void {
this.statusForm = new PaymentStatusForm("Waiting for payment");
this.statusForm.showProgressWorking();
this.statusForm.visible = false;
addChild(this.statusForm);
}
public function setPhoneForm() : void {
this.phoneForm.visible = true;
this.codeConfirmForm.visible = false;
this.statusForm.visible = false;
this.state = LeogamingPhonePaymentState.PHONE;
this.render();
}
public function setCodeConfirmForm() : void {
this.phoneForm.visible = false;
this.codeConfirmForm.visible = true;
this.codeConfirmForm.clear();
this.proceedButton.visible = false;
this.state = LeogamingPhonePaymentState.CONFIRM;
this.render();
}
public function setWaitingPayment() : void {
this.phoneForm.visible = false;
this.codeConfirmForm.visible = false;
this.proceedButton.visible = false;
this.statusForm.visible = true;
this.state = LeogamingPhonePaymentState.WAIT;
}
private function addPhoneForm() : void {
this.phoneForm = new LeogamingPhoneForm();
this.phoneForm.visible = true;
addChild(this.phoneForm);
}
private function addCodeConfirmCode() : void {
this.codeConfirmForm = new LeogamingCodeConfirmForm();
this.codeConfirmForm.visible = false;
addChild(this.codeConfirmForm);
}
private function addProceedButton() : void {
this.proceedButton = new ProceedButton();
this.proceedButton.label = localeService.getText(TanksLocale.TEXT_PAYMENT_BUTTON_PROCEED_TEXT);
this.proceedButton.visible = false;
this.proceedButton.width = PROCEED_BUTTON_WIDTH;
addChild(this.proceedButton);
}
private function setEvents() : void {
this.phoneForm.addEventListener(ValidationEvent.VALID,this.onValid);
this.phoneForm.addEventListener(ValidationEvent.INVALID,this.onInvalid);
this.codeConfirmForm.addEventListener(ValidationEvent.VALID,this.onValid);
this.codeConfirmForm.addEventListener(ValidationEvent.INVALID,this.onInvalid);
this.proceedButton.addEventListener(MouseEvent.CLICK,this.onProceedClicked);
}
private function onProceedClicked(param1:Event) : void {
var local2:String = null;
if(this.state == LeogamingPhonePaymentState.PHONE) {
payMode.adapt(LeogamingPaymentMode).sendPhone(this.phoneForm.getPhoneNumber());
this.proceedButton.visible = false;
} else if(this.state == LeogamingPhonePaymentState.CONFIRM) {
local2 = this.codeConfirmForm.getCodeConfirm();
payMode.adapt(LeogamingPaymentMode).sendCode(local2);
this.codeConfirmForm.clear();
this.setWaitingPayment();
}
}
private function onValid(param1:ValidationEvent) : void {
this.proceedButton.visible = true;
}
private function onInvalid(param1:ValidationEvent) : void {
this.proceedButton.visible = false;
}
private function render() : void {
if(this.state == LeogamingPhonePaymentState.PHONE) {
this.proceedButton.y = this.phoneForm.y + this.phoneForm.height + MARGIN;
} else {
this.proceedButton.y = this.codeConfirmForm.y + this.codeConfirmForm.height + MARGIN;
}
this.proceedButton.x = this.codeConfirmForm.x + this.codeConfirmForm.width - this.proceedButton.width;
}
override public function destroy() : void {
this.phoneForm.removeEventListener(ValidationEvent.VALID,this.onValid);
this.phoneForm.removeEventListener(ValidationEvent.INVALID,this.onInvalid);
this.codeConfirmForm.removeEventListener(ValidationEvent.VALID,this.onValid);
this.codeConfirmForm.removeEventListener(ValidationEvent.INVALID,this.onInvalid);
this.proceedButton.removeEventListener(MouseEvent.CLICK,this.onProceedClicked);
this.phoneForm.destroy();
this.codeConfirmForm.destroy();
super.destroy();
}
public function reset() : void {
this.setPhoneForm();
this.phoneForm.reset();
}
public function proceed() : void {
if(this.state == LeogamingPhonePaymentState.PHONE) {
this.setCodeConfirmForm();
} else if(this.state == LeogamingPhonePaymentState.CONFIRM) {
this.setWaitingPayment();
}
}
}
}
|
package platform.client.fp10.core.type {
public interface AutoClosable {
function close() : void;
}
}
|
package alternativa.tanks.utils {
import alternativa.math.Vector3;
import alternativa.physics.collision.primitives.CollisionBox;
public class EncryptedCollisionBoxData {
private var hs:Vector3;
private const halfSizeX:EncryptedNumber = new EncryptedNumberImpl();
private const halfSizeY:EncryptedNumber = new EncryptedNumberImpl();
private const halfSizeZ:EncryptedNumber = new EncryptedNumberImpl();
public function EncryptedCollisionBoxData(param1:CollisionBox) {
super();
this.hs = param1.hs;
this.halfSizeX.setNumber(param1.hs.x);
this.halfSizeY.setNumber(param1.hs.y);
this.halfSizeZ.setNumber(param1.hs.z);
}
public function isInvalid() : Boolean {
return this.hs.x != this.halfSizeX.getNumber() || this.hs.y != this.halfSizeY.getNumber() || this.hs.z != this.halfSizeZ.getNumber();
}
}
}
|
package projects.tanks.client.battlefield.models.user.pause {
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 TankPauseModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var _disablePauseId:Long = Long.getLong(1241917416,-199564253);
private var model:IModel;
public function TankPauseModelServer(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 disablePause() : 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._disablePauseId,this.protocolBuffer);
var local2:IGameObject = Model.object;
var local3:ISpace = local2.space;
local3.commandSender.sendCommand(local1);
this.protocolBuffer.optionalMap.clear();
}
}
}
|
package alternativa.tanks.models.weapon.ricochet {
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 RicochetWeaponCallbackEvents implements RicochetWeaponCallback {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function RicochetWeaponCallbackEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function onShot(param1:int, param2:int, param3:Vector3) : void {
var i:int = 0;
var m:RicochetWeaponCallback = null;
var time:int = param1;
var shotId:int = param2;
var shotDirection:Vector3 = param3;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = RicochetWeaponCallback(this.impl[i]);
m.onShot(time,shotId,shotDirection);
i++;
}
}
finally {
Model.popObject();
}
}
public function onDummyShot(param1:int) : void {
var i:int = 0;
var m:RicochetWeaponCallback = null;
var time:int = param1;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = RicochetWeaponCallback(this.impl[i]);
m.onDummyShot(time);
i++;
}
}
finally {
Model.popObject();
}
}
public function onTargetHit(param1:int, param2:Body, param3:Vector.<Vector3>) : void {
var i:int = 0;
var m:RicochetWeaponCallback = null;
var shotId:int = param1;
var targetBody:Body = param2;
var impactPoints:Vector.<Vector3> = param3;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = RicochetWeaponCallback(this.impl[i]);
m.onTargetHit(shotId,targetBody,impactPoints);
i++;
}
}
finally {
Model.popObject();
}
}
public function onStaticHit(param1:int, param2:Vector.<Vector3>) : void {
var i:int = 0;
var m:RicochetWeaponCallback = null;
var shotId:int = param1;
var impactPoints:Vector.<Vector3> = param2;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = RicochetWeaponCallback(this.impl[i]);
m.onStaticHit(shotId,impactPoints);
i++;
}
}
finally {
Model.popObject();
}
}
}
}
|
package controls.lifeindicator
{
public class LineCharge extends HorizontalBar
{
[Embed(source="844.png")]
private static const bitmapLeft:Class;
[Embed(source="1163.png")]
private static const bitmapCenter:Class;
[Embed(source="1210.png")]
private static const bitmapRight:Class;
public function LineCharge()
{
super(new bitmapLeft().bitmapData,new bitmapCenter().bitmapData,new bitmapRight().bitmapData);
}
}
}
|
package projects.tanks.clients.fp10.libraries.tanksservices.service.rank {
import projects.tanks.client.tanksservices.model.rankloader.RankInfo;
public class RankServiceImpl implements RankService {
private var _rankNames:Vector.<String>;
public function RankServiceImpl() {
super();
}
public function getRankName(param1:int) : String {
if(param1 > this._rankNames.length) {
return this._rankNames[this._rankNames.length - 1] + " " + (param1 + 1 - this._rankNames.length);
}
return this._rankNames[param1 - 1];
}
public function getNormalizedRankIndex(param1:int) : int {
return Math.min(this._rankNames.length,param1);
}
public function initRanks(param1:Vector.<RankInfo>) : void {
var local2:RankInfo = null;
this._rankNames = new Vector.<String>(param1.length);
for each(local2 in param1) {
this._rankNames[local2.index - 1] = local2.name;
}
}
public function get rankNames() : Vector.<String> {
return this._rankNames;
}
}
}
|
package alternativa.protocol.impl {
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.*;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.codec.complex.ByteArrayCodec;
import alternativa.protocol.codec.complex.StringCodec;
import alternativa.protocol.codec.primitive.BooleanCodec;
import alternativa.protocol.codec.primitive.ByteCodec;
import alternativa.protocol.codec.primitive.DoubleCodec;
import alternativa.protocol.codec.primitive.FloatCodec;
import alternativa.protocol.codec.primitive.IntCodec;
import alternativa.protocol.codec.primitive.LongCodec;
import alternativa.protocol.codec.primitive.ShortCodec;
import alternativa.protocol.codec.primitive.UIntCodec;
import alternativa.protocol.codec.primitive.UShortCodec;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Byte;
import alternativa.types.Float;
import alternativa.types.Long;
import alternativa.types.Short;
import alternativa.types.UShort;
import flash.utils.ByteArray;
import flash.utils.Dictionary;
import flash.utils.IDataInput;
import flash.utils.IDataOutput;
public class Protocol implements IProtocol {
[Inject]
public static var clientLog:IClientLog;
private static const LOG_CHANNEL:String = "protocol";
public static var defaultInstance:IProtocol = new Protocol();
private var info2codec:Object = new Object();
private var listInitCodec:Dictionary = new Dictionary(false);
public function Protocol() {
super();
this.registerCodec(new TypeCodecInfo(int,false),new IntCodec());
this.registerCodec(new TypeCodecInfo(Short,false),new ShortCodec());
this.registerCodec(new TypeCodecInfo(Byte,false),new ByteCodec());
this.registerCodec(new TypeCodecInfo(UShort,false),new UShortCodec());
this.registerCodec(new TypeCodecInfo(uint,false),new UIntCodec());
this.registerCodec(new TypeCodecInfo(Number,false),new DoubleCodec());
this.registerCodec(new TypeCodecInfo(Float,false),new FloatCodec());
this.registerCodec(new TypeCodecInfo(Boolean,false),new BooleanCodec());
this.registerCodec(new TypeCodecInfo(Long,false),new LongCodec());
this.registerCodec(new TypeCodecInfo(String,false),new StringCodec());
this.registerCodec(new TypeCodecInfo(ByteArray,false),new ByteArrayCodec());
this.registerCodec(new TypeCodecInfo(int,true),new OptionalCodecDecorator(new IntCodec()));
this.registerCodec(new TypeCodecInfo(Short,true),new OptionalCodecDecorator(new ShortCodec()));
this.registerCodec(new TypeCodecInfo(Byte,true),new OptionalCodecDecorator(new ByteCodec()));
this.registerCodec(new TypeCodecInfo(UShort,true),new OptionalCodecDecorator(new UShortCodec()));
this.registerCodec(new TypeCodecInfo(uint,true),new OptionalCodecDecorator(new UIntCodec()));
this.registerCodec(new TypeCodecInfo(Number,true),new OptionalCodecDecorator(new DoubleCodec()));
this.registerCodec(new TypeCodecInfo(Float,true),new OptionalCodecDecorator(new FloatCodec()));
this.registerCodec(new TypeCodecInfo(Boolean,true),new OptionalCodecDecorator(new BooleanCodec()));
this.registerCodec(new TypeCodecInfo(Long,true),new OptionalCodecDecorator(new LongCodec()));
this.registerCodec(new TypeCodecInfo(String,true),new OptionalCodecDecorator(new StringCodec()));
this.registerCodec(new TypeCodecInfo(ByteArray,true),new OptionalCodecDecorator(new ByteArrayCodec()));
}
public function registerCodec(param1:ICodecInfo, param2:ICodec) : void {
this.info2codec[param1] = param2;
}
public function registerCodecForType(param1:Class, param2:ICodec) : void {
this.info2codec[new TypeCodecInfo(param1,false)] = param2;
this.info2codec[new TypeCodecInfo(param1,true)] = new OptionalCodecDecorator(param2);
}
public function getCodec(param1:ICodecInfo) : ICodec {
var local2:ICodec = this.info2codec[param1];
if(local2 == null) {
throw Error("Codec not found for " + param1);
}
if(this.listInitCodec[local2] == null) {
this.listInitCodec[local2] = local2;
local2.init(this);
}
return local2;
}
public function makeCodecInfo(param1:Class) : ICodecInfo {
return new TypeCodecInfo(param1,false);
}
public function wrapPacket(param1:IDataOutput, param2:ProtocolBuffer, param3:CompressionType) : void {
PacketHelper.wrapPacket(param1,param2,param3);
}
public function unwrapPacket(param1:IDataInput, param2:ProtocolBuffer, param3:CompressionType) : Boolean {
return PacketHelper.unwrapPacket(param1,param2,param3);
}
public function decode(param1:Class, param2:ByteArray) : * {
var local3:ICodec = this.getCodec(this.makeCodecInfo(param1));
var local4:ByteArray = new ByteArray();
var local5:ProtocolBuffer = new ProtocolBuffer(local4,local4,new OptionalMap());
this.unwrapPacket(param2,local5,CompressionType.DEFLATE_AUTO);
return local3.decode(local5);
}
}
}
|
package projects.tanks.client.garage.models.item.temporary {
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 TemporaryItemModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:TemporaryItemModelServer;
private var client:ITemporaryItemModelBase = ITemporaryItemModelBase(this);
private var modelId:Long = Long.getLong(906608998,-1418680370);
public function TemporaryItemModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new TemporaryItemModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(TemporaryItemCC,false)));
}
protected function getInitParam() : TemporaryItemCC {
return TemporaryItemCC(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 forms.premium {
import flash.display.Bitmap;
import flash.display.BitmapData;
public class PremiumItemLock {
private static const premiumItemLockClass:Class = PremiumItemLock_premiumItemLockClass;
private static const premiumItemLock:BitmapData = new premiumItemLockClass().bitmapData;
public function PremiumItemLock() {
super();
}
public static function createInstance() : Bitmap {
return new Bitmap(premiumItemLock);
}
}
}
|
package projects.tanks.client.battlefield.models.inventory.cooldown {
import alternativa.types.Long;
public class DependedCooldownItem {
private var _duration:int;
private var _id:Long;
public function DependedCooldownItem(param1:int = 0, param2:Long = null) {
super();
this._duration = param1;
this._id = param2;
}
public function get duration() : int {
return this._duration;
}
public function set duration(param1:int) : void {
this._duration = param1;
}
public function get id() : Long {
return this._id;
}
public function set id(param1:Long) : void {
this._id = param1;
}
public function toString() : String {
var local1:String = "DependedCooldownItem [";
local1 += "duration = " + this.duration + " ";
local1 += "id = " + this.id + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.models.dom.hud
{
import alternativa.console.ConsoleVarFloat;
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.core.Camera3D;
import alternativa.engine3d.core.Object3D;
import alternativa.math.Matrix4;
import alternativa.math.Vector3;
import alternativa.tanks.models.battlefield.BattlefieldModel;
use namespace alternativa3d;
public class KeyPointMarkers
{
private static const CON_HIDE_SCALE:ConsoleVarFloat = new ConsoleVarFloat("ph_scale",0.12,0.00001,10);
private static const CON_FULL_HIDE_SCALE:ConsoleVarFloat = new ConsoleVarFloat("pfh_scale",0.1,0.00001,10);
private static const m:Matrix4 = new Matrix4();
private static const m1:Matrix4 = new Matrix4();
private static const v:Vector3 = new Vector3();
private static const pointPosition:Vector3 = new Vector3();
private static const cameraPosition:Vector3 = new Vector3();
private static const direction:Vector3 = new Vector3();
private var camera:Camera3D;
private var markers:Vector.<KeyPointMarker>;
public var battleService:BattlefieldModel;
public function KeyPointMarkers(param1:Camera3D, battle:BattlefieldModel)
{
super();
this.markers = new Vector.<KeyPointMarker>();
this.battleService = battle;
this.camera = param1;
}
private static function getPerspectiveScale(param1:Camera3D, param2:Vector3) : Number
{
var _loc3_:Number = Math.cos(param1.rotationX);
var _loc4_:Number = Math.sin(param1.rotationX);
var _loc5_:Number = Math.cos(param1.rotationY);
var _loc6_:Number = Math.sin(param1.rotationY);
var _loc7_:Number = Math.cos(param1.rotationZ);
var _loc8_:Number = Math.sin(param1.rotationZ);
var _loc9_:Number = _loc7_ * _loc6_ * _loc3_ + _loc8_ * _loc4_;
var _loc10_:Number = -_loc7_ * _loc4_ + _loc6_ * _loc8_ * _loc3_;
var _loc11_:Number = _loc5_ * _loc3_;
var _loc12_:Number = -_loc9_ * param1.x - _loc10_ * param1.y - _loc11_ * param1.z;
var _loc13_:Number = param1.view.width * 0.5;
var _loc14_:Number = param1.view.height * 0.5;
var _loc15_:Number = Math.sqrt(_loc13_ * _loc13_ + _loc14_ * _loc14_) / Math.tan(param1.fov * 0.5);
var _loc16_:Number = _loc9_ * param2.x + _loc10_ * param2.y + _loc11_ * param2.z + _loc12_;
return _loc15_ / _loc16_;
}
private static function composeObject3DMatrix(param1:Object3D) : Matrix4
{
var _loc2_:Number = Math.cos(param1.rotationX);
var _loc3_:Number = Math.sin(param1.rotationX);
var _loc4_:Number = Math.cos(param1.rotationY);
var _loc5_:Number = Math.sin(param1.rotationY);
var _loc6_:Number = Math.cos(param1.rotationZ);
var _loc7_:Number = Math.sin(param1.rotationZ);
var _loc8_:Number = _loc6_ * _loc5_;
var _loc9_:Number = _loc7_ * _loc5_;
var _loc10_:Number = _loc4_ * param1.scaleX;
var _loc11_:Number = _loc3_ * param1.scaleY;
var _loc12_:Number = _loc2_ * param1.scaleY;
var _loc13_:Number = _loc2_ * param1.scaleZ;
var _loc14_:Number = _loc3_ * param1.scaleZ;
m1.a = _loc6_ * _loc10_;
m1.b = _loc8_ * _loc11_ - _loc7_ * _loc12_;
m1.c = _loc8_ * _loc13_ + _loc7_ * _loc14_;
m1.d = param1.x;
m1.e = _loc7_ * _loc10_;
m1.f = _loc9_ * _loc11_ + _loc6_ * _loc12_;
m1.g = _loc9_ * _loc13_ - _loc6_ * _loc14_;
m1.h = param1.y;
m1.i = -_loc5_ * param1.scaleX;
m1.j = _loc4_ * _loc11_;
m1.k = _loc4_ * _loc13_;
m1.l = param1.z;
return m1;
}
public function show() : void
{
var _loc1_:KeyPointMarker = null;
for each(_loc1_ in this.markers)
{
_loc1_.visible = true;
}
}
public function addMarker(param1:KeyPointMarker) : void
{
param1.visible = false;
this.battleService.bfData.viewport.overlay.addChild(param1);
this.markers.push(param1);
}
public function render(param1:int, param2:int) : void
{
var _loc4_:KeyPointMarker = null;
var _loc3_:Matrix4 = this.calculateProjectionMatrix();
for each(_loc4_ in this.markers)
{
this.updateMarker(_loc4_,_loc3_);
}
}
private function updateMarker(param1:KeyPointMarker, param2:Matrix4) : void
{
var _loc7_:Number = NaN;
param1.readPosition3D(v);
var vect:Vector3 = v;
v.vTransformBy4(param2);
this.projectToView(v);
var _loc4_:Number = this.getMarginY();
var _loc5_:Boolean = this.isPointInsideViewport(v.x,v.y,15,_loc4_);
var distance:Number = vect.distanceTo(new Vector3(this.camera.x,this.camera.y,this.camera.z));
if(v.z > 0 && _loc5_)
{
_loc7_ = 1;
if(_loc7_ == 0)
{
param1.visible = false;
param1.alpha = 0;
}
else
{
param1.visible = true;
param1.alpha = _loc7_;
}
}
else
{
param1.alpha = 1;
param1.visible = false;
}
if(distance < 5000)
{
param1.alpha = distance / (5000 * (5000 / distance) * (5000 / distance) * (5000 / distance));
}
param1.x = int(v.x + this.battleService.getWidth() / 2 - 12);
param1.y = int(v.y + this.battleService.getHeight() / 2 - 12);
param1.update();
}
private function projectToView(param1:Vector3) : void
{
var _loc2_:Number = NaN;
var _loc3_:Number = NaN;
if(param1.z > 0.001)
{
param1.x = param1.x * this.camera.viewSizeX / param1.z;
param1.y = param1.y * this.camera.viewSizeY / param1.z;
}
else if(param1.z < -0.001)
{
param1.x = -param1.x * this.camera.viewSizeX / param1.z;
param1.y = -param1.y * this.camera.viewSizeY / param1.z;
}
else
{
_loc2_ = this.battleService.getDiagonalSquared();
_loc3_ = Math.sqrt(param1.x * param1.x + param1.y * param1.y);
param1.x *= _loc2_ / _loc3_;
param1.y *= _loc2_ / _loc3_;
}
}
private function getMarginY() : int
{
switch(this.battleService.screenSize)
{
case 10:
return 70;
case 9:
return 40;
default:
return 15;
}
}
private function isPointInsideViewport(param1:Number, param2:Number, param3:Number, param4:Number) : Boolean
{
var _loc6_:Number = this.battleService.getWidth() / 2 - param3;
var _loc7_:Number = this.battleService.getHeight() / 2 - param4;
return param1 >= -_loc6_ && param1 <= _loc6_ && param2 >= -_loc7_ && param2 <= _loc7_;
}
private function calculateProjectionMatrix() : Matrix4
{
var _loc5_:Number = NaN;
var _loc6_:Number = NaN;
var _loc7_:Number = NaN;
var _loc15_:Number = NaN;
var _loc1_:Number = this.camera.viewSizeX / this.camera.focalLength;
var _loc2_:Number = this.camera.viewSizeY / this.camera.focalLength;
var _loc3_:Number = Math.cos(this.camera.rotationX);
var _loc4_:Number = Math.sin(this.camera.rotationX);
_loc5_ = Math.cos(this.camera.rotationY);
_loc6_ = Math.sin(this.camera.rotationY);
_loc7_ = Math.cos(this.camera.rotationZ);
var _loc8_:Number = Math.sin(this.camera.rotationZ);
var _loc9_:Number = _loc7_ * _loc6_;
var _loc10_:Number = _loc8_ * _loc6_;
var _loc11_:Number = _loc5_ * this.camera.scaleX;
var _loc12_:Number = _loc4_ * this.camera.scaleY;
var _loc13_:Number = _loc3_ * this.camera.scaleY;
var _loc14_:Number = _loc3_ * this.camera.scaleZ;
_loc15_ = _loc4_ * this.camera.scaleZ;
m.a = _loc7_ * _loc11_ * _loc1_;
m.b = (_loc9_ * _loc12_ - _loc8_ * _loc13_) * _loc2_;
m.c = _loc9_ * _loc14_ + _loc8_ * _loc15_;
m.d = this.camera.x;
m.e = _loc8_ * _loc11_ * _loc1_;
m.f = (_loc10_ * _loc12_ + _loc7_ * _loc13_) * _loc2_;
m.g = _loc10_ * _loc14_ - _loc7_ * _loc15_;
m.h = this.camera.y;
m.i = -_loc6_ * this.camera.scaleX * _loc1_;
m.j = _loc5_ * _loc12_ * _loc2_;
m.k = _loc5_ * _loc14_;
m.l = this.camera.z;
var _loc16_:Object3D = this.camera;
while(_loc16_._parent != null)
{
_loc16_ = _loc16_._parent;
m.append(composeObject3DMatrix(_loc16_));
}
m.invert();
return m;
}
}
}
|
package projects.tanks.client.commons.models.externalauth {
public interface IExternalAuthApiModelBase {
}
}
|
package projects.tanks.client.garage.models.item.droppablegold {
public class DroppableGoldItemCC {
private var _showDroppableGoldAuthor:Boolean;
public function DroppableGoldItemCC(param1:Boolean = false) {
super();
this._showDroppableGoldAuthor = param1;
}
public function get showDroppableGoldAuthor() : Boolean {
return this._showDroppableGoldAuthor;
}
public function set showDroppableGoldAuthor(param1:Boolean) : void {
this._showDroppableGoldAuthor = param1;
}
public function toString() : String {
var local1:String = "DroppableGoldItemCC [";
local1 += "showDroppableGoldAuthor = " + this.showDroppableGoldAuthor + " ";
return local1 + "]";
}
}
}
|
package _codec.projects.tanks.client.panel.model.payment.modes.gate2shop {
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.payment.modes.gate2shop.Gate2ShopPaymentCC;
public class CodecGate2ShopPaymentCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_emailInputRequired:ICodec;
public function CodecGate2ShopPaymentCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_emailInputRequired = param1.getCodec(new TypeCodecInfo(Boolean,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:Gate2ShopPaymentCC = new Gate2ShopPaymentCC();
local2.emailInputRequired = this.codec_emailInputRequired.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:Gate2ShopPaymentCC = Gate2ShopPaymentCC(param2);
this.codec_emailInputRequired.encode(param1,local3.emailInputRequired);
}
}
}
|
package alternativa.tanks.bonuses {
import alternativa.math.Matrix3;
import alternativa.math.Matrix4;
import alternativa.math.Vector3;
import alternativa.physics.Body;
import alternativa.physics.PhysicsMaterial;
import alternativa.physics.collision.CollisionShape;
import alternativa.physics.collision.primitives.CollisionBox;
import alternativa.tanks.battle.BattleRunnerProvider;
import alternativa.tanks.battle.Trigger;
import alternativa.tanks.physics.CollisionGroup;
public class BonusTrigger extends BattleRunnerProvider implements Trigger {
private var bonus:BattleBonus;
private var collisionBox:CollisionBox;
public function BonusTrigger(param1:BattleBonus) {
super();
this.bonus = param1;
var local2:Number = BonusConst.BONUS_HALF_SIZE;
this.collisionBox = new CollisionBox(new Vector3(local2,local2,local2),CollisionGroup.BONUS_WITH_TANK,PhysicsMaterial.DEFAULT_MATERIAL);
}
public function enable() : void {
getBattleRunner().addTrigger(this);
}
public function disable() : void {
getBattleRunner().removeTrigger(this);
}
public function update(param1:Matrix4) : void {
var local2:Matrix4 = this.collisionBox.transform;
local2.copy(param1);
this.collisionBox.calculateAABB();
}
public function updateByComponents(param1:Number, param2:Number, param3:Number, param4:Number, param5:int, param6:Number) : void {
var local7:Matrix4 = this.collisionBox.transform;
local7.setMatrix(param1,param2,param3,param4,param5,param6);
this.collisionBox.calculateAABB();
}
public function setTransform(param1:Vector3, param2:Matrix3) : void {
var local3:Matrix4 = this.collisionBox.transform;
local3.setFromMatrix3(param2,param1);
this.collisionBox.calculateAABB();
}
public function checkTrigger(param1:Body) : void {
var local3:CollisionShape = null;
var local2:int = 0;
while(local2 < param1.numCollisionShapes) {
local3 = param1.collisionShapes[local2];
if(getBattleRunner().getCollisionDetector().testCollision(local3,this.collisionBox)) {
this.bonus.onTriggerActivated();
return;
}
local2++;
}
}
}
}
|
package alternativa.tanks.model.profile
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class GiftUserInfo_outcomingBitmap extends BitmapAsset
{
public function GiftUserInfo_outcomingBitmap()
{
super();
}
}
}
|
package projects.tanks.client.clans.clan {
import alternativa.types.Long;
public interface IClanModelBase {
function alreadyInAccepted(param1:String) : void;
function alreadyInClan(param1:String) : void;
function alreadyInClanIncoming(param1:String, param2:Long) : void;
function alreadyInClanOutgoing(param1:String) : void;
function alreadyInUserOutgoing(param1:String, param2:Long) : void;
function maxMembers() : void;
function userExist() : void;
function userLowRank() : void;
function userNotExist() : void;
}
}
|
package projects.tanks.clients.tankslauncershared.dishonestprogressbar {
import mx.core.BitmapAsset;
[Embed(source="/_assets/projects.tanks.clients.tankslauncershared.dishonestprogressbar.LoadingLabel_loadingLabelEsClass.png")]
public class LoadingLabel_loadingLabelEsClass extends BitmapAsset {
public function LoadingLabel_loadingLabelEsClass() {
super();
}
}
}
|
package alternativa.tanks.gui
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class ItemInfoPanel_bitmapTurretRotationRate extends BitmapAsset
{
public function ItemInfoPanel_bitmapTurretRotationRate()
{
super();
}
}
}
|
package alternativa.tanks.services.initialeffects {
import alternativa.types.Long;
public class ClientBattleEffect {
public var receiveTime:int;
public var userId:Long;
public var effectId:int;
public var duration:int;
public var effectLevel:int;
public function ClientBattleEffect(param1:int, param2:Long, param3:int, param4:int, param5:int) {
super();
this.receiveTime = param1;
this.userId = param2;
this.effectId = param3;
this.duration = param4;
this.effectLevel = param5;
}
}
}
|
package alternativa.gfx.core
{
import flash.display3D.textures.Texture;
public class TextureResource extends Resource
{
protected var useNullTexture:Boolean = false;
private var _texture:Texture = null;
public function TextureResource()
{
super();
}
override public function dispose() : void
{
super.dispose();
if(this._texture != null)
{
this._texture.dispose();
this._texture = null;
}
}
public function get texture() : Texture
{
if(this.useNullTexture)
{
return this.getNullTexture();
}
return this._texture;
}
public function set texture(param1:Texture) : void
{
this._texture = param1;
}
protected function getNullTexture() : Texture
{
return null;
}
}
}
|
package alternativa.tanks.models.tank.ultimate.titan {
import alternativa.engine3d.materials.TextureMaterial;
import alternativa.engine3d.objects.Mesh;
import alternativa.math.Vector3;
import alternativa.tanks.battle.scene3d.scene3dcontainer.Scene3DContainer;
import alternativa.tanks.camera.GameCamera;
import alternativa.tanks.sfx.GraphicEffect;
import alternativa.tanks.utils.objectpool.Pool;
import alternativa.tanks.utils.objectpool.PooledObject;
public class ShieldEffect extends PooledObject implements GraphicEffect {
private static const ALPHA:Number = 0.9;
private static const ALPHA_PULSATION_FREQ:Number = 4;
private static const ALPHA_PULSATION_AMPLITUDE:Number = 0.2;
public static const FADE:Number = 0.5;
private var container:Scene3DContainer;
private var sphere:Mesh = null;
private var time:Number;
private var fadeOutTime:Number;
private var fadeOut:Boolean;
private var position:Vector3;
public function ShieldEffect(param1:Pool) {
super(param1);
}
public function init(param1:TextureMaterial, param2:Mesh, param3:Vector3, param4:Number, param5:Number) : void {
this.position = param3;
if(this.sphere == null) {
this.sphere = param2.clone() as Mesh;
this.sphere.shadowMapAlphaThreshold = 2;
this.sphere.depthMapAlphaThreshold = 2;
this.sphere.useLight = false;
this.sphere.useShadowMap = false;
this.sphere.softAttenuation = 200;
}
this.sphere.setMaterialToAllFaces(param1);
this.sphere.x = param3.x;
this.sphere.y = param3.y;
this.sphere.z = param3.z;
this.sphere.rotationX = 0;
this.sphere.rotationY = 0;
this.sphere.rotationZ = param5;
this.sphere.calculateBounds();
var local6:Number = 0.5 * (this.sphere.boundMaxX - this.sphere.boundMinX);
var local7:Number = param4 / local6;
this.sphere.scaleX = local7;
this.sphere.scaleY = local7;
this.sphere.scaleZ = local7;
this.sphere.alpha = ALPHA;
this.time = 0;
this.fadeOut = false;
this.fadeOutTime = 0;
}
public function addedToScene(param1:Scene3DContainer) : void {
this.container = param1;
param1.addChild(this.sphere);
}
public function play(param1:int, param2:GameCamera) : Boolean {
var local3:Number = param1 / 1000;
this.time += local3;
var local4:Number = ALPHA + Math.sin(this.time * ALPHA_PULSATION_FREQ) * ALPHA_PULSATION_AMPLITUDE;
if(this.fadeOut) {
this.fadeOutTime += local3;
this.sphere.alpha = local4 * (FADE - this.fadeOutTime) / FADE;
return this.sphere.alpha > 0;
}
if(this.time <= FADE) {
this.sphere.alpha = local4 * this.time / FADE;
return true;
}
this.sphere.alpha = local4;
return true;
}
public function stop() : void {
this.fadeOut = true;
}
public function destroy() : void {
this.container.removeChild(this.sphere);
this.sphere.setMaterialToAllFaces(null);
this.container = null;
recycle();
}
public function kill() : void {
this.sphere.alpha = 0;
}
}
}
|
package alternativa.tanks.model.payment.shop.paint {
import alternativa.tanks.gui.shop.shopitems.item.base.ShopButton;
import alternativa.tanks.gui.shop.shopitems.item.details.ShopItemDetails;
import alternativa.tanks.gui.shop.shopitems.item.garageitem.PaintPackageButton;
import alternativa.tanks.gui.shop.shopitems.item.garageitem.PaintPackageDescriptionView;
import alternativa.tanks.model.payment.shop.ShopItemDetailsView;
import alternativa.tanks.model.payment.shop.ShopItemView;
import projects.tanks.client.panel.model.shop.paintpackage.IPaintPackageModelBase;
import projects.tanks.client.panel.model.shop.paintpackage.PaintPackageModelBase;
[ModelInfo]
public class PaintPackageModel extends PaintPackageModelBase implements IPaintPackageModelBase, PaintPackage, ShopItemView, ShopItemDetailsView {
public function PaintPackageModel() {
super();
}
public function getName() : String {
return getInitParam().name;
}
public function getDescription() : String {
return getInitParam().description;
}
public function getButtonView() : ShopButton {
return new PaintPackageButton(object);
}
public function getDetailsView() : ShopItemDetails {
return new PaintPackageDescriptionView(object);
}
public function isDetailedViewRequired() : Boolean {
return true;
}
}
}
|
package alternativa.tanks.gui.crystalbutton {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.crystalbutton.UpgradeSaleIcon_bitmapSale.png")]
public class UpgradeSaleIcon_bitmapSale extends BitmapAsset {
public function UpgradeSaleIcon_bitmapSale() {
super();
}
}
}
|
package alternativa.tanks.models.weapon.shared.streamweapon {
import alternativa.math.Vector3;
import alternativa.physics.Body;
import alternativa.tanks.battle.objects.tank.Weapon;
[ModelInterface]
public interface IStreamWeaponCallback {
function start(param1:int) : void;
function stop(param1:int) : void;
function onTick(param1:Weapon, param2:Vector.<Body>, param3:Vector.<Number>, param4:Vector.<Vector3>, param5:int) : void;
}
}
|
package alternativa.tanks.models.weapon.machinegun.sfx {
[ModelInterface]
public interface IMachineGunSFXModel {
function getSfxData() : MachineGunSFXData;
}
}
|
package projects.tanks.client.partners.impl.china.china3rdplatform.auth {
public interface IChina3rdPlatformLoginModelBase {
}
}
|
package alternativa.tanks.models.tank.gearscore {
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class GearScoreInfoEvents implements GearScoreInfo {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function GearScoreInfoEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function getScore() : int {
var result:int = 0;
var i:int = 0;
var m:GearScoreInfo = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = GearScoreInfo(this.impl[i]);
result = int(m.getScore());
i++;
}
}
finally {
Model.popObject();
}
return result;
}
}
}
|
package alternativa.tanks.models.battle.gui.inventory.cooldown {
import alternativa.tanks.display.EffectBlinkerUtil;
import alternativa.tanks.models.battle.gui.inventory.InventoryIcons;
import alternativa.tanks.models.battle.gui.inventory.splash.ISplashController;
import alternativa.tanks.models.battle.gui.inventory.splash.SplashColor;
import alternativa.tanks.sfx.Blinker;
import flash.utils.getTimer;
import utils.tweener.TweenLite;
public class EffectController {
private var _view:CooldownIndicator;
private var _startTime:int;
private var _durationTime:int;
private var _isFillEffect:Boolean;
private var _fillTween:TweenLite;
private var _addingTween:TweenLite;
private var _isActive:Boolean;
private var _isAddingEffect:Boolean;
private var _finishCallback:Function;
private var _finishFillEffectCallBack:Function;
private var _effectProgressData:CooldownProgressData;
private var _splashController:ISplashController;
private var _slotNumber:int;
private var _inventoryIcon:InventoryIcons;
private var blinker:Blinker;
private var blinkingPeriod:int;
private var lastUpdateTime:int = -1;
private var blinkerInited:Boolean = false;
private var effectStopped:Boolean = false;
private var blinkEnabled:Boolean = true;
public function EffectController(param1:int, param2:InventoryIcons, param3:CooldownIndicator, param4:ISplashController, param5:Function, param6:Function, param7:Boolean = true) {
super();
this.blinkEnabled = param7;
this._slotNumber = param1;
this._inventoryIcon = param2;
this._view = param3;
this._splashController = param4;
this._finishCallback = param5;
this._finishFillEffectCallBack = param6;
this._effectProgressData = new CooldownProgressData();
this.blinkingPeriod = EffectBlinkerUtil.getBlinkingPeriod(this._slotNumber);
this.blinker = EffectBlinkerUtil.createBlinker(this._slotNumber);
}
public function update(param1:int) : void {
var local2:int = 0;
if(!this._isActive) {
return;
}
if(this.lastUpdateTime < 0) {
this.lastUpdateTime = param1;
} else {
local2 = param1 - this.lastUpdateTime;
this.lastUpdateTime = param1;
if(this.blinkEnabled && param1 - this._startTime > this._durationTime - this.blinkingPeriod) {
if(!this.effectStopped) {
this.blinkIcon(param1,local2);
}
} else if(this.blinkerInited) {
this.resetVarsForBlink();
}
}
if(this._isFillEffect || this._isAddingEffect) {
return;
}
this._effectProgressData.progress = this.calculateProgress(param1,this._startTime,this._durationTime);
if(this._effectProgressData.progress > 1) {
this._effectProgressData.progress = 1;
this.finish();
}
this._view.setProgress(this._effectProgressData.progress,1);
}
public function get isActive() : Boolean {
return this._isActive;
}
public function destroy() : void {
if(this._isActive) {
this._isActive = false;
this._isFillEffect = false;
this._isAddingEffect = false;
this._startTime = -1;
this._durationTime = 0;
this._effectProgressData.reset();
this._view.setProgress(0,0);
TweenLite.killTweensOf(this._effectProgressData);
this.resetVarsForBlink();
}
}
public function getProgress() : Number {
if(this._isAddingEffect) {
return this._effectProgressData.addingProgress;
}
if(this._isFillEffect) {
return this._effectProgressData.fillProgress;
}
return this._effectProgressData.progress;
}
public function changeTime(param1:int, param2:int, param3:Boolean) : void {
var local4:int = 0;
var local5:int = 0;
var local6:int = 0;
this.effectStopped = false;
if(this._isActive) {
local4 = this.getRemainingTime();
local5 = param2 - local4;
if(local5 > InventoryCooldownItem.TOLERANCE_EFFECT_TIME) {
if(this._isFillEffect || this._isAddingEffect) {
if(this._isFillEffect) {
local6 = param2 - (local4 + InventoryCooldownItem.FILL_EFFECT_TIME_IN_SEC * 1000);
}
if(this._isAddingEffect) {
local6 = param2 - (local4 + InventoryCooldownItem.ADDING_EFFECT_TIME_IN_SEC * 1000);
}
if(local6 > InventoryCooldownItem.TOLERANCE_EFFECT_TIME) {
this._durationTime += local6;
}
} else {
this.activateAddingEffect(param1,param2,param3);
}
}
} else {
this.activate(param1,param2,param3);
}
}
public function stopEffect() : void {
this.resetVarsForBlink();
this.effectStopped = true;
this._startTime = -1;
this._durationTime = 0;
}
private function blinkIcon(param1:int, param2:int) : void {
var local3:Number = NaN;
if(this.blinkerInited) {
local3 = this.blinker.updateValue(param1,param2);
if(local3 != this._inventoryIcon.alpha) {
this._inventoryIcon.alpha = local3;
}
} else {
this.blinker.setMinValue(EffectBlinkerUtil.MIN_VALUE);
this.blinker.init(param1);
this.blinkerInited = true;
}
}
private function finish() : void {
this._isActive = false;
this._startTime = -1;
this._durationTime = 0;
this.resetVarsForBlink();
this._effectProgressData.reset();
this._view.setProgress(this._effectProgressData.progress,1);
this._finishCallback.apply();
}
private function calculateProgress(param1:int, param2:int, param3:int) : Number {
var local4:int = param1 - param2;
return local4 / param3;
}
private function activate(param1:int, param2:int, param3:Boolean) : void {
if(this._isActive || param2 <= 0) {
return;
}
this._isActive = true;
this.activateFillEffect(param1,param2,param3);
}
public function activateInfinite() : void {
this._isActive = true;
this._effectProgressData.progress = 0;
this._effectProgressData.fillProgress = 1;
this._durationTime = int.MAX_VALUE;
}
private function activateFillEffect(param1:int, param2:int, param3:Boolean) : void {
if(this._isFillEffect) {
this.changeTime(param1,param2,param3);
return;
}
var local4:int = param2 - InventoryCooldownItem.FILL_EFFECT_TIME_IN_SEC * 1000;
if(local4 > InventoryCooldownItem.TOLERANCE_EFFECT_TIME) {
this._isFillEffect = true;
this._splashController.startFlash(SplashColor.getColor(this._slotNumber));
this._startTime = param1 + InventoryCooldownItem.FILL_EFFECT_TIME_IN_SEC * 1000;
this._durationTime = local4;
this._effectProgressData.progress = 0;
this._effectProgressData.fillProgress = 1;
this._fillTween = TweenLite.to(this._effectProgressData,InventoryCooldownItem.FILL_EFFECT_TIME_IN_SEC,{
"fillProgress":0,
"onComplete":this.onCompleteFill
});
}
}
private function onCompleteFill() : void {
this._effectProgressData.fillProgress = 0;
this._view.setProgress(0,1);
this._finishFillEffectCallBack.apply();
this._isFillEffect = false;
}
private function getRemainingTime() : int {
if(this._durationTime == 0 || this._startTime == -1) {
return 0;
}
return this._durationTime - (getTimer() - this._startTime);
}
private function activateAddingEffect(param1:int, param2:int, param3:Boolean) : void {
if(this._isAddingEffect) {
this.changeTime(param1,param2,param3);
return;
}
var local4:int = param2 - InventoryCooldownItem.ADDING_EFFECT_TIME_IN_SEC * 1000;
if(local4 > 0) {
this._isAddingEffect = true;
this._splashController.startFlash(SplashColor.getColor(this._slotNumber));
this._startTime = param1 + InventoryCooldownItem.ADDING_EFFECT_TIME_IN_SEC * 1000;
this._durationTime = local4;
this._effectProgressData.addingProgress = this._effectProgressData.progress;
this._addingTween = TweenLite.to(this._effectProgressData,InventoryCooldownItem.ADDING_EFFECT_TIME_IN_SEC,{
"addingProgress":0,
"onComplete":this.onCompleteAdding
});
}
}
private function onCompleteAdding() : void {
this._effectProgressData.addingProgress = 0;
this._view.setProgress(0,1);
this._isAddingEffect = false;
}
private function resetVarsForBlink() : void {
this._inventoryIcon.alpha = 1;
this.blinkerInited = false;
}
}
}
|
package _codec.projects.tanks.client.tanksservices.model.rankloader {
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.tanksservices.model.rankloader.RankInfo;
import projects.tanks.client.tanksservices.model.rankloader.RankLoaderCC;
public class CodecRankLoaderCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_ranks:ICodec;
public function CodecRankLoaderCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_ranks = param1.getCodec(new CollectionCodecInfo(new TypeCodecInfo(RankInfo,false),false,1));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:RankLoaderCC = new RankLoaderCC();
local2.ranks = this.codec_ranks.decode(param1) as Vector.<RankInfo>;
return local2;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:RankLoaderCC = RankLoaderCC(param2);
this.codec_ranks.encode(param1,local3.ranks);
}
}
}
|
package projects.tanks.clients.fp10.libraries.tanksservices.model.payment {
[ModelInterface]
public interface PayModeProceed {
function proceedPayment() : void;
}
}
|
package projects.tanks.client.partners.impl.odnoklassniki {
public interface IOdnoklassnikiInternalLoginModelBase {
}
}
|
package projects.tanks.client.clans.panel.foreignclan {
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 ForeignClanModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var _acceptRequestId:Long = Long.getLong(597277327,247338170);
private var _rejectRequestId:Long = Long.getLong(566860404,-2140933699);
private var _revokeRequestId:Long = Long.getLong(564507337,1859866244);
private var _sendRequestId:Long = Long.getLong(1916918059,-1477631238);
private var model:IModel;
public function ForeignClanModelServer(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 acceptRequest() : 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._acceptRequestId,this.protocolBuffer);
var local2:IGameObject = Model.object;
var local3:ISpace = local2.space;
local3.commandSender.sendCommand(local1);
this.protocolBuffer.optionalMap.clear();
}
public function rejectRequest() : 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._rejectRequestId,this.protocolBuffer);
var local2:IGameObject = Model.object;
var local3:ISpace = local2.space;
local3.commandSender.sendCommand(local1);
this.protocolBuffer.optionalMap.clear();
}
public function revokeRequest() : 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._revokeRequestId,this.protocolBuffer);
var local2:IGameObject = Model.object;
var local3:ISpace = local2.space;
local3.commandSender.sendCommand(local1);
this.protocolBuffer.optionalMap.clear();
}
public function sendRequest() : 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._sendRequestId,this.protocolBuffer);
var local2:IGameObject = Model.object;
var local3:ISpace = local2.space;
local3.commandSender.sendCommand(local1);
this.protocolBuffer.optionalMap.clear();
}
}
}
|
package alternativa.tanks.model.gift.opened
{
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.BlendMode;
import flash.display.PixelSnapping;
import flash.display.Sprite;
public class Dust extends Sprite
{
private var motes:Array;
private var count:int;
private var bottom:Number;
public function Dust(param1:BitmapData, param2:int, param3:Number, param4:Number)
{
var _loc7_:Bitmap = null;
var _loc8_:Number = NaN;
this.motes = new Array();
super();
this.count = param2;
this.bottom = param4;
var _loc5_:Number = param3 / param2;
var _loc6_:int = 0;
while(_loc6_ < param2)
{
_loc7_ = new Bitmap(param1,PixelSnapping.NEVER,true);
_loc7_.x = _loc6_ * _loc5_;
_loc7_.y = Math.random() * param3;
_loc8_ = 0.2 + Math.random();
_loc7_.scaleX = _loc8_;
_loc7_.scaleY = _loc8_;
_loc7_.blendMode = BlendMode.ADD;
addChild(_loc7_);
this.motes.push(_loc7_);
_loc6_++;
}
}
public function update() : void
{
var _loc4_:Bitmap = null;
_loc4_ = null;
var _loc1_:Number = this.bottom / 3;
var _loc2_:Number = _loc1_ + _loc1_;
var _loc3_:int = 0;
while(_loc3_ < this.count)
{
_loc4_ = this.motes[_loc3_];
_loc4_.y += 2;
if(_loc4_.y > this.bottom)
{
_loc4_.y = 0;
}
if(_loc4_.y < _loc1_)
{
_loc4_.alpha = _loc4_.y / _loc1_;
}
else if(_loc4_.y < _loc2_)
{
_loc4_.alpha = 1;
}
else
{
_loc4_.alpha = 1 - (_loc4_.y - _loc2_) / _loc1_;
}
_loc3_++;
}
}
}
}
|
package projects.tanks.client.panel.model.referrals.notification {
public interface INewReferralsNotifierModelBase {
function notifyNewReferralsCountUpdated(param1:int) : void;
function notifyReferralAdded(param1:int) : void;
}
}
|
package _codec.projects.tanks.client.commons.types {
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.commons.types.ItemGarageProperty;
public class VectorCodecItemGaragePropertyLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecItemGaragePropertyLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new EnumCodecInfo(ItemGarageProperty,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.<ItemGarageProperty> = new Vector.<ItemGarageProperty>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = ItemGarageProperty(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:ItemGarageProperty = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<ItemGarageProperty> = Vector.<ItemGarageProperty>(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.profile
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class GiftUserInfo_spinsBitmap extends BitmapAsset
{
public function GiftUserInfo_spinsBitmap()
{
super();
}
}
}
|
package alternativa.tanks.gui.error {
import alternativa.osgi.OSGi;
import alternativa.osgi.service.locale.ILocaleService;
import flash.display.DisplayObject;
import platform.client.fp10.core.service.errormessage.IMessageBox;
import platform.client.fp10.core.service.errormessage.errors.ConnectionClosedError;
import platform.client.fp10.core.service.errormessage.errors.ErrorType;
import projects.tanks.clients.fp10.libraries.TanksLocale;
public class CustomErrorWindow implements IMessageBox {
private static var localeService:ILocaleService;
private var errorForm:ErrorForm;
public function CustomErrorWindow(param1:OSGi) {
super();
localeService = ILocaleService(param1.getService(ILocaleService));
this.errorForm = new ErrorForm(localeService);
this.errorForm.setSupportUrl(localeService.getText(TanksLocale.TEXT_CONNECTION_CLOSED_WIKI_LINK));
}
public function getDisplayObject(param1:ErrorType) : DisplayObject {
var local2:String = this.getErrorText(param1);
this.errorForm.setErrorText(local2);
return this.errorForm;
}
private function getErrorText(param1:ErrorType) : String {
if(param1 is ConnectionClosedError) {
return localeService.getText(TanksLocale.TEXT_CONNECTION_CLOSED_MESSAGE);
}
return param1.getMessage();
}
public function hide() : void {
if(this.errorForm.parent != null) {
this.errorForm.parent.removeChild(this.errorForm);
}
}
}
}
|
package projects.tanks.client.panel.model.panel {
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 PanelModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:PanelModelServer;
private var client:IPanelModelBase = IPanelModelBase(this);
private var modelId:Long = Long.getLong(469211470,2012932912);
public function PanelModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new PanelModelServer(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.upgrade {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.upgrade.UpgradeProgressForm_leftProgressResource.png")]
public class UpgradeProgressForm_leftProgressResource extends BitmapAsset {
public function UpgradeProgressForm_leftProgressResource() {
super();
}
}
}
|
package alternativa.tanks.models.battle.battlefield {
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.osgi.service.display.IDisplay;
import alternativa.tanks.battle.BattleRunner;
import alternativa.tanks.battle.BattleRunnerProvider;
import alternativa.tanks.battle.LogicUnit;
import flash.display.Stage;
import flash.display.StageQuality;
import projects.tanks.clients.flash.commons.models.gpu.GPUCapabilities;
public class StageFrameRateController extends BattleRunnerProvider implements LogicUnit {
[Inject]
public static var clientLog:IClientLog;
[Inject]
public static var display:IDisplay;
private static const MAX_HARDWARE_FRAME_RATE:Number = 60;
private static const MAX_SOFTWARE_FRAME_RATE:Number = 40;
private static const MIN_FRAMERATE:int = 10;
private static const FRAME_RATE_ADJUST_INTERVAL:int = 30;
private var stage:Stage;
private var timeStatistics:TimeStatistics;
private var maxFrameRate:int;
private var frameCounter:int;
private var initialFrameRate:Number;
private var initialStageQuality:String;
private var adaptiveFPSEnabled:Boolean;
public function StageFrameRateController(param1:Stage, param2:BattleRunner, param3:TimeStatistics) {
super();
this.stage = param1;
this.timeStatistics = param3;
this.setMaxFrameRate();
this.saveStageParams();
this.setInitialStageParams();
}
private function saveStageParams() : void {
this.initialFrameRate = this.stage.frameRate;
this.initialStageQuality = this.stage.quality;
}
private function setInitialStageParams() : void {
this.stage.frameRate = this.maxFrameRate;
if(GPUCapabilities.gpuEnabled) {
this.stage.quality = StageQuality.MEDIUM;
} else {
this.stage.quality = StageQuality.LOW;
}
}
public function restoreStageParams() : void {
this.stage.frameRate = this.initialFrameRate;
this.stage.quality = this.initialStageQuality;
}
private function setMaxFrameRate() : void {
if(GPUCapabilities.gpuEnabled) {
this.maxFrameRate = MAX_HARDWARE_FRAME_RATE;
} else {
this.maxFrameRate = MAX_SOFTWARE_FRAME_RATE;
}
}
public function setAdaptiveFrameRate(param1:Boolean) : void {
if(param1) {
this.enableAdaptiveFrameRate();
} else {
this.disableAdaptiveFrameRate();
}
}
private function enableAdaptiveFrameRate() : void {
if(!this.adaptiveFPSEnabled) {
getBattleRunner().addLogicUnit(this);
this.adaptiveFPSEnabled = true;
}
}
private function disableAdaptiveFrameRate() : void {
if(this.adaptiveFPSEnabled) {
getBattleRunner().removeLogicUnit(this);
this.adaptiveFPSEnabled = false;
this.stage.frameRate = this.maxFrameRate;
}
}
public function runLogic(param1:int, param2:int) : void {
++this.frameCounter;
if(this.frameCounter == FRAME_RATE_ADJUST_INTERVAL) {
this.frameCounter = 0;
if(this.currentFpsIsTooLow()) {
this.decreaseStageFrameRate();
} else {
this.increaseStageFrameRate();
}
}
}
private function currentFpsIsTooLow() : Boolean {
return this.timeStatistics.fps < display.stage.frameRate - 1;
}
private function decreaseStageFrameRate() : void {
display.stage.frameRate = this.timeStatistics.fps < MIN_FRAMERATE ? MIN_FRAMERATE : this.timeStatistics.fps;
}
private function increaseStageFrameRate() : void {
var local1:Number = display.stage.frameRate + 1;
display.stage.frameRate = local1 > this.maxFrameRate ? this.maxFrameRate : local1;
}
}
}
|
package alternativa.resource.factory
{
import alternativa.resource.MovieClipResource;
import alternativa.resource.Resource;
public class MovieClipResourceFactory implements IResourceFactory
{
public function MovieClipResourceFactory()
{
super();
}
public function createResource(resourceType:int) : Resource
{
return new MovieClipResource();
}
}
}
|
package forms.ranks {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/forms.ranks.DefaultRanksBitmaps_bitmapBigRank30.png")]
public class DefaultRanksBitmaps_bitmapBigRank30 extends BitmapAsset {
public function DefaultRanksBitmaps_bitmapBigRank30() {
super();
}
}
}
|
package alternativa.tanks.models.battle.gui.inventory {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.models.battle.gui.inventory.HudInventoryIcon_goldBgdClass.png")]
public class HudInventoryIcon_goldBgdClass extends BitmapAsset {
public function HudInventoryIcon_goldBgdClass() {
super();
}
}
}
|
package alternativa.tanks.models.weapon.gauss {
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class GaussSkinEvents implements GaussSkin {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function GaussSkinEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function getSkin() : GaussTurretSkin {
var result:GaussTurretSkin = null;
var i:int = 0;
var m:GaussSkin = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = GaussSkin(this.impl[i]);
result = m.getSkin();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
}
}
|
package alternativa.tanks.loader {
import flash.events.IEventDispatcher;
public interface ILoaderWindowService extends IEventDispatcher {
function show() : void;
function showDelayed(param1:int) : void;
function hide() : void;
function hideForcibly() : void;
function isInProgress() : Boolean;
}
}
|
package _codec.projects.tanks.client.panel.model.challenge.rewarding {
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.challenge.rewarding.Tier;
import projects.tanks.client.panel.model.challenge.rewarding.TierItem;
public class CodecTier implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_battlePassItem:ICodec;
private var codec_freeItem:ICodec;
private var codec_needShowBattlePassItem:ICodec;
private var codec_stars:ICodec;
public function CodecTier() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_battlePassItem = param1.getCodec(new TypeCodecInfo(TierItem,true));
this.codec_freeItem = param1.getCodec(new TypeCodecInfo(TierItem,true));
this.codec_needShowBattlePassItem = param1.getCodec(new TypeCodecInfo(Boolean,false));
this.codec_stars = param1.getCodec(new TypeCodecInfo(int,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:Tier = new Tier();
local2.battlePassItem = this.codec_battlePassItem.decode(param1) as TierItem;
local2.freeItem = this.codec_freeItem.decode(param1) as TierItem;
local2.needShowBattlePassItem = this.codec_needShowBattlePassItem.decode(param1) as Boolean;
local2.stars = this.codec_stars.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:Tier = Tier(param2);
this.codec_battlePassItem.encode(param1,local3.battlePassItem);
this.codec_freeItem.encode(param1,local3.freeItem);
this.codec_needShowBattlePassItem.encode(param1,local3.needShowBattlePassItem);
this.codec_stars.encode(param1,local3.stars);
}
}
}
|
package alternativa.tanks.models.battle.gui.inventory.readytouse {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.models.battle.gui.inventory.readytouse.LightPillarEffect_topClass.png")]
public class LightPillarEffect_topClass extends BitmapAsset {
public function LightPillarEffect_topClass() {
super();
}
}
}
|
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_devastationIconClass.png")]
public class KillMessageOutputLine_devastationIconClass extends BitmapAsset {
public function KillMessageOutputLine_devastationIconClass() {
super();
}
}
}
|
package alternativa.physics.collision
{
import alternativa.physics.Body;
public interface IRayCollisionPredicate
{
function considerBody(param1:Body) : Boolean;
}
}
|
package platform.client.fp10.core.model {
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class ObjectUnloadListenerEvents implements ObjectUnloadListener {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function ObjectUnloadListenerEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function objectUnloaded() : void {
var i:int = 0;
var m:ObjectUnloadListener = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = ObjectUnloadListener(this.impl[i]);
m.objectUnloaded();
i++;
}
}
finally {
Model.popObject();
}
}
}
}
|
package alternativa.tanks.gui
{
import controls.Label;
import flash.display.BitmapData;
import flash.display.Shape;
import flash.display.Sprite;
import flash.geom.Matrix;
public class ModTable extends Sprite
{
[Embed(source="756.png")]
private static const bitmapUpgradeSelectionLeft:Class;
private static const selectionLeftBd:BitmapData = new bitmapUpgradeSelectionLeft().bitmapData;
[Embed(source="757.png")]
private static const bitmapUpgradeSelectionCenter:Class;
private static const selectionCenterBd:BitmapData = new bitmapUpgradeSelectionCenter().bitmapData;
[Embed(source="1055.png")]
private static const bitmapUpgradeSelectionRight:Class;
private static const selectionRightBd:BitmapData = new bitmapUpgradeSelectionRight().bitmapData;
private var _maxCostWidth:int;
public var constWidth:int;
public var rows:Array;
public const vSpace:int = 0;
private var selection:Shape;
private var selectedRowIndex:int = -1;
private var xt:Boolean;
private var rowCount:int = 4;
public function ModTable()
{
var row:ModInfoRow = null;
super();
this.rows = new Array();
this.selection = new Shape();
addChild(this.selection);
this.selection.x = 3;
for(var i:int = 0; i < this.rowCount; i++)
{
row = new ModInfoRow();
addChild(row);
row.y = (row.h + this.vSpace) * i;
this.rows.push(row);
row.upgradeIndicator.value = i;
}
}
public function changeRowCount(num:int) : void
{
var row:ModInfoRow = null;
var _row:ModInfoRow = null;
var i:int = 0;
row = null;
this.rowCount = num;
for each(_row in this.rows)
{
removeChild(_row);
}
this.rows = new Array();
for(i = 0; i < this.rowCount; i++)
{
row = new ModInfoRow();
if(num == 1)
{
row.hideUpgradeIndicator();
}
addChild(row);
row.y = (row.h + this.vSpace) * i;
this.rows.push(row);
row.upgradeIndicator.value = i;
}
}
public function select(index:int) : void
{
var row:ModInfoRow = null;
if(this.selectedRowIndex != -1)
{
row = ModInfoRow(this.rows[this.selectedRowIndex]);
if(row != null)
{
row.unselect();
}
}
this.selectedRowIndex = index;
this.selection.y = (ModInfoRow(this.rows[0]).h + this.vSpace) * index;
row = ModInfoRow(this.rows[this.selectedRowIndex]);
if(row != null)
{
row.select();
}
}
public function resizeSelection(w:int) : void
{
var width:int = w - 6;
var m:Matrix = new Matrix();
this.selection.graphics.clear();
this.selection.graphics.beginBitmapFill(selectionLeftBd);
this.selection.graphics.drawRect(0,0,selectionLeftBd.width,selectionLeftBd.height);
this.selection.graphics.beginBitmapFill(selectionCenterBd);
this.selection.graphics.drawRect(selectionLeftBd.width,0,width - selectionLeftBd.width - selectionRightBd.width,selectionCenterBd.height);
m.tx = width - selectionRightBd.width;
this.selection.graphics.beginBitmapFill(selectionRightBd,m);
this.selection.graphics.drawRect(width - selectionRightBd.width,0,selectionRightBd.width,selectionRightBd.height);
}
public function correctNonintegralValues() : void
{
var n:int = 0;
var label:Label = null;
var index:int = 0;
var nonintegralIndexes:Array = new Array();
var row:ModInfoRow = this.rows[0] as ModInfoRow;
var l:int = row.labels.length;
for(var i:int = 0; i < this.rowCount; i++)
{
row = this.rows[i] as ModInfoRow;
for(n = 0; n < l; n++)
{
label = row.labels[n] as Label;
if(label.text.indexOf(".") != -1)
{
nonintegralIndexes.push(n);
}
}
}
for(i = 0; i < this.rowCount; i++)
{
row = this.rows[i];
for(n = 0; n < nonintegralIndexes.length; n++)
{
index = nonintegralIndexes[n];
label = row.labels[index] as Label;
if(label.text.indexOf(".") == -1)
{
label.text += ".0";
}
}
}
}
public function get maxCostWidth() : int
{
return this._maxCostWidth;
}
public function set maxCostWidth(value:int) : void
{
this._maxCostWidth = value;
var row:ModInfoRow = this.rows[0] as ModInfoRow;
this.constWidth = row.upgradeIndicator.width + row.rankIcon.width + 3 + row.crystalIcon.width + this._maxCostWidth + row.hSpace * 3;
for(var i:int = 0; i < this.rowCount; i++)
{
row = this.rows[i] as ModInfoRow;
row.costWidth = this._maxCostWidth;
}
}
}
}
|
package alternativa.tanks.gui
{
import alternativa.init.Main;
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.locale.constants.TextConst;
import controls.DefaultButton;
import controls.Label;
import controls.TankCheckBox;
import controls.TankInput;
import controls.TankWindow;
import controls.TankWindowHeader;
import controls.TextArea;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.text.TextFormat;
import forms.events.LoginFormEvent;
public class BugReportWindow extends Sprite
{
private var sendButton:DefaultButton;
private var sendScreenShot:TankCheckBox;
private var cancelButton:DefaultButton;
private var window:TankWindow;
private var summaryLabel:Label;
private var summaryInput:TankInput;
private var descriptionLabel:Label;
private var descriptionInput:TextArea;
private var image:Bitmap;
private var imageSize:Point;
private var windowSize:Point;
private const windowWidth:int = 340;
private const windowMargin:int = 12;
private const margin:int = 9;
private const buttonSize:Point = new Point(104,33);
private var progressBar:ProgressBar;
private var cropRectContainer:Sprite;
private var cropLeftButton:Sprite;
private var cropTopButton:Sprite;
private var cropRightButton:Sprite;
private var cropBottomButton:Sprite;
private var cropTopLeftButton:Sprite;
private var cropTopRightButton:Sprite;
private var cropBottomLeftButton:Sprite;
private var cropBottomRightButton:Sprite;
private var holdPoint:Point;
private var moveButton:Sprite;
private var dragButton:Sprite;
private var cropRect:Rectangle;
private var k:Number;
private var maxCropWidth:int;
private var maxCropHeight:int;
public function BugReportWindow(screenShot:BitmapData)
{
var localeService:ILocaleService = null;
super();
localeService = ILocaleService(Main.osgi.getService(ILocaleService));
this.imageSize = new Point(this.windowWidth - this.windowMargin * 2,(this.windowWidth - this.windowMargin * 2) * (screenShot.height / screenShot.width));
var tf:TextFormat = new TextFormat("Tahoma",14,16777215,true);
this.windowSize = new Point(this.windowWidth,this.imageSize.y * 2 + this.windowMargin * 5 + this.buttonSize.y);
this.window = new TankWindow(this.windowSize.x,this.windowSize.y);
addChild(this.window);
this.window.headerLang = localeService.getText(TextConst.GUI_LANG);
this.window.header = TankWindowHeader.BUG_REPORT;
var screenPreview:BitmapData = new BitmapData(this.imageSize.x,this.imageSize.y,true,0);
var matrix:Matrix = new Matrix();
this.k = this.imageSize.x / screenShot.width;
matrix.scale(this.k,this.k);
screenPreview.draw(screenShot,matrix);
this.maxCropWidth = screenShot.width * this.k;
this.maxCropHeight = screenShot.height * this.k;
this.image = new Bitmap(screenPreview);
addChild(this.image);
this.image.x = this.windowMargin;
this.image.y = this.windowMargin;
this.cropRect = new Rectangle();
this.holdPoint = new Point();
this.cropRectContainer = new Sprite();
addChild(this.cropRectContainer);
this.cropRectContainer.x = this.image.x;
this.cropRectContainer.y = this.image.y;
this.moveButton = new Sprite();
this.cropRectContainer.addChild(this.moveButton);
this.moveButton.addEventListener(MouseEvent.MOUSE_DOWN,this.holdMoveButton);
this.moveButton.addEventListener(MouseEvent.DOUBLE_CLICK,this.maximizeCropRect);
this.cropLeftButton = this.createCropButton();
this.cropTopButton = this.createCropButton();
this.cropRightButton = this.createCropButton();
this.cropBottomButton = this.createCropButton();
this.cropTopLeftButton = this.createCropButton();
this.cropTopRightButton = this.createCropButton();
this.cropBottomLeftButton = this.createCropButton();
this.cropBottomRightButton = this.createCropButton();
this.setCropRect(this.image.width - this.maxCropWidth >> 1,this.image.height - this.maxCropHeight >> 1,this.maxCropWidth,this.maxCropHeight);
this.sendScreenShot = new TankCheckBox();
this.sendScreenShot.label = localeService.getText(TextConst.BUG_REPORT_SEND_SCREEN_SHOT_CHECKBOX_LABEL_TEXT);
this.sendScreenShot.checked = true;
addChild(this.sendScreenShot);
this.sendScreenShot.x = this.windowMargin;
this.sendScreenShot.y = this.image.y + this.image.height + this.windowMargin;
this.summaryLabel = new Label();
addChild(this.summaryLabel);
this.summaryLabel.text = localeService.getText(TextConst.BUG_REPORT_SUMMARY_LABEL_TEXT);
this.summaryLabel.x = this.windowMargin - 2;
this.summaryLabel.y = this.sendScreenShot.y + this.sendScreenShot.height + this.windowMargin;
this.summaryInput = new TankInput();
addChild(this.summaryInput);
this.summaryInput.width = this.imageSize.x;
this.summaryInput.x = this.windowMargin;
this.summaryInput.y = this.summaryLabel.y + this.summaryLabel.textHeight + Math.round(this.windowMargin * 0.5);
this.summaryInput.addEventListener(LoginFormEvent.TEXT_CHANGED,this.onSummaryChange);
this.descriptionLabel = new Label();
addChild(this.descriptionLabel);
this.descriptionLabel.text = localeService.getText(TextConst.BUG_REPORT_DESCRIPTION_LABEL_TEXT);
this.descriptionLabel.x = this.windowMargin - 2;
this.descriptionLabel.y = this.summaryInput.y + this.summaryInput.height + this.windowMargin;
this.descriptionInput = new TextArea();
addChild(this.descriptionInput);
this.descriptionInput.tf.addEventListener(Event.CHANGE,this.onDescriptionChange);
this.descriptionInput.width = this.imageSize.x;
this.descriptionInput.x = this.windowMargin;
this.descriptionInput.y = this.descriptionLabel.y + this.descriptionLabel.textHeight + Math.round(this.windowMargin * 0.5);
this.descriptionInput.height = this.windowSize.y - this.windowMargin * 2 - this.buttonSize.y - this.descriptionInput.y + 2;
this.descriptionInput.maxChars = 500;
this.cancelButton = new DefaultButton();
addChild(this.cancelButton);
this.cancelButton.label = localeService.getText(TextConst.BUG_REPORT_BUTTON_CANCEL_TEXT);
this.cancelButton.x = this.windowSize.x - this.buttonSize.x - this.margin + 5;
this.cancelButton.y = this.windowSize.y - this.buttonSize.y - this.margin;
this.sendButton = new DefaultButton();
addChild(this.sendButton);
this.sendButton.label = localeService.getText(TextConst.BUG_REPORT_BUTTON_SEND_TEXT);
this.sendButton.x = this.windowSize.x - this.buttonSize.x * 2 - 1 - this.margin;
this.sendButton.y = this.windowSize.y - this.buttonSize.y - this.margin;
this.sendButton.enable = false;
this.cancelButton.addEventListener(MouseEvent.CLICK,this.onCancelClick);
this.sendButton.addEventListener(MouseEvent.CLICK,this.onSendClick);
this.progressBar = new ProgressBar();
addChild(this.progressBar);
this.progressBar.resize(this.windowSize.x - this.windowMargin * 2);
this.progressBar.x = this.windowMargin;
this.progressBar.y = this.sendButton.y + Math.round((this.buttonSize.y - this.progressBar.height) * 0.5);
this.progressBar.visible = false;
}
public function showProgress() : void
{
this.cancelButton.visible = false;
this.sendButton.visible = false;
this.progressBar.visible = true;
}
public function setProgress(n:Number) : void
{
this.progressBar.setProgress(n);
}
public function get summary() : String
{
return this.summaryInput.value;
}
public function get description() : String
{
return this.descriptionInput.text;
}
public function get sendScreenshot() : Boolean
{
return this.sendScreenShot.checked;
}
private function onSummaryChange(e:Event) : void
{
if(this.descriptionInput.text.length >= 3 && this.summaryInput.value.length >= 3)
{
this.sendButton.enable = true;
}
else
{
this.sendButton.enable = false;
}
}
private function onDescriptionChange(e:Event) : void
{
if(this.descriptionInput.text.length >= 3 && this.summaryInput.value.length >= 3)
{
this.sendButton.enable = true;
}
else
{
this.sendButton.enable = false;
}
}
private function onCancelClick(e:MouseEvent) : void
{
dispatchEvent(new Event(Event.CANCEL,true,false));
}
private function onSendClick(e:MouseEvent) : void
{
dispatchEvent(new Event(Event.COMPLETE,true,false));
}
private function createCropButton() : Sprite
{
var button:Sprite = new Sprite();
button.graphics.beginFill(13369344,1);
button.graphics.drawRect(-5,-5,10,10);
this.cropRectContainer.addChild(button);
button.addEventListener(MouseEvent.MOUSE_DOWN,this.holdCropButton);
return button;
}
private function setCropRect(x:int, y:int, width:int, height:int, resize:Boolean = true) : void
{
this.cropRect.x = x;
this.cropRect.y = y;
this.cropRect.width = width;
this.cropRect.height = height;
this.cropRectContainer.graphics.clear();
this.cropRectContainer.graphics.beginFill(0,0.5);
this.cropRectContainer.graphics.drawRect(0,0,this.image.width,this.image.height);
this.cropRectContainer.graphics.lineStyle(1,13369344);
this.cropRectContainer.graphics.drawRect(x,y,width,height);
this.cropLeftButton.x = x;
this.cropLeftButton.y = y + int(this.cropRect.height * 0.5);
this.cropTopButton.x = x + int(this.cropRect.width * 0.5);
this.cropTopButton.y = y;
this.cropRightButton.x = x + width;
this.cropRightButton.y = y + int(this.cropRect.height * 0.5);
this.cropBottomButton.x = x + int(this.cropRect.width * 0.5);
this.cropBottomButton.y = y + height;
this.cropTopLeftButton.x = x;
this.cropBottomLeftButton.x = x;
this.cropTopRightButton.x = x + width;
this.cropBottomRightButton.x = x + width;
this.cropTopLeftButton.y = y;
this.cropTopRightButton.y = y;
this.cropBottomLeftButton.y = y + height;
this.cropBottomRightButton.y = y + height;
if(resize)
{
this.moveButton.x = x;
this.moveButton.y = y;
this.moveButton.graphics.clear();
this.moveButton.graphics.beginFill(204,0);
this.moveButton.graphics.drawRect(0,0,width,height);
}
}
private function holdCropButton(e:MouseEvent) : void
{
this.dragButton = e.target as Sprite;
this.holdPoint.x = this.dragButton.mouseX;
this.holdPoint.y = this.dragButton.mouseY;
Main.stage.addEventListener(MouseEvent.MOUSE_UP,this.dropCropButton);
Main.stage.addEventListener(MouseEvent.MOUSE_MOVE,this.dragCropButton);
}
private function dragCropButton(e:MouseEvent) : void
{
if(this.dragButton == this.cropLeftButton || this.dragButton == this.cropRightButton)
{
this.dragButton.x += this.dragButton.mouseX - this.holdPoint.x;
}
else if(this.dragButton == this.cropTopButton || this.dragButton == this.cropBottomButton)
{
this.dragButton.y += this.dragButton.mouseY - this.holdPoint.y;
}
else
{
this.dragButton.x += this.dragButton.mouseX - this.holdPoint.x;
this.dragButton.y += this.dragButton.mouseY - this.holdPoint.y;
}
switch(this.dragButton)
{
case this.cropLeftButton:
if(this.cropLeftButton.x < 0)
{
this.cropLeftButton.x = 0;
}
if(this.cropLeftButton.x > this.cropRightButton.x)
{
this.cropLeftButton.x = this.cropRightButton.x;
}
if(this.cropRightButton.x - this.cropLeftButton.x > this.maxCropWidth)
{
this.cropLeftButton.x = this.cropRightButton.x - this.maxCropWidth;
}
break;
case this.cropTopButton:
if(this.cropTopButton.y < 0)
{
this.cropTopButton.y = 0;
}
if(this.cropTopButton.y > this.cropBottomButton.y)
{
this.cropTopButton.y = this.cropBottomButton.y;
}
if(this.cropBottomButton.y - this.cropTopButton.y > this.maxCropHeight)
{
this.cropTopButton.y = this.cropBottomButton.y - this.maxCropHeight;
}
break;
case this.cropRightButton:
if(this.cropRightButton.x > this.image.width)
{
this.cropRightButton.x = this.image.width;
}
if(this.cropRightButton.x < this.cropLeftButton.x)
{
this.cropRightButton.x = this.cropLeftButton.x;
}
if(this.cropRightButton.x - this.cropLeftButton.x > this.maxCropWidth)
{
this.cropRightButton.x = this.cropLeftButton.x + this.maxCropWidth;
}
break;
case this.cropBottomButton:
if(this.cropBottomButton.y > this.image.height)
{
this.cropBottomButton.y = this.image.height;
}
if(this.cropBottomButton.y < this.cropTopButton.y)
{
this.cropBottomButton.y = this.cropTopButton.y;
}
if(this.cropBottomButton.y - this.cropTopButton.y > this.maxCropHeight)
{
this.cropBottomButton.y = this.cropTopButton.y + this.maxCropHeight;
}
break;
case this.cropTopLeftButton:
if(this.cropTopLeftButton.x < 0)
{
this.cropTopLeftButton.x = 0;
}
if(this.cropTopLeftButton.x > this.cropRightButton.x)
{
this.cropTopLeftButton.x = this.cropRightButton.x;
}
if(this.cropRightButton.x - this.cropTopLeftButton.x > this.maxCropWidth)
{
this.cropTopLeftButton.x = this.cropRightButton.x - this.maxCropWidth;
}
if(this.cropTopLeftButton.y < 0)
{
this.cropTopLeftButton.y = 0;
}
if(this.cropTopLeftButton.y > this.cropBottomButton.y)
{
this.cropTopLeftButton.y = this.cropBottomButton.y;
}
if(this.cropBottomButton.y - this.cropTopLeftButton.y > this.maxCropHeight)
{
this.cropTopLeftButton.y = this.cropBottomButton.y - this.maxCropHeight;
}
this.cropTopButton.y = this.cropTopLeftButton.y;
this.cropLeftButton.x = this.cropTopLeftButton.x;
break;
case this.cropTopRightButton:
if(this.cropTopRightButton.x > this.image.width)
{
this.cropTopRightButton.x = this.image.width;
}
if(this.cropTopRightButton.x < this.cropLeftButton.x)
{
this.cropTopRightButton.x = this.cropLeftButton.x;
}
if(this.cropTopRightButton.x - this.cropLeftButton.x > this.maxCropWidth)
{
this.cropTopRightButton.x = this.cropLeftButton.x + this.maxCropWidth;
}
if(this.cropTopRightButton.y < 0)
{
this.cropTopRightButton.y = 0;
}
if(this.cropTopRightButton.y > this.cropBottomButton.y)
{
this.cropTopRightButton.y = this.cropBottomButton.y;
}
if(this.cropBottomButton.y - this.cropTopRightButton.y > this.maxCropHeight)
{
this.cropTopRightButton.y = this.cropBottomButton.y - this.maxCropHeight;
}
this.cropTopButton.y = this.cropTopRightButton.y;
this.cropRightButton.x = this.cropTopRightButton.x;
break;
case this.cropBottomLeftButton:
if(this.cropBottomLeftButton.x < 0)
{
this.cropBottomLeftButton.x = 0;
}
if(this.cropBottomLeftButton.x > this.cropRightButton.x)
{
this.cropBottomLeftButton.x = this.cropRightButton.x;
}
if(this.cropRightButton.x - this.cropBottomLeftButton.x > this.maxCropWidth)
{
this.cropBottomLeftButton.x = this.cropRightButton.x - this.maxCropWidth;
}
if(this.cropBottomLeftButton.y > this.image.height)
{
this.cropBottomLeftButton.y = this.image.height;
}
if(this.cropBottomLeftButton.y < this.cropTopButton.y)
{
this.cropBottomLeftButton.y = this.cropTopButton.y;
}
if(this.cropBottomLeftButton.y - this.cropTopButton.y > this.maxCropHeight)
{
this.cropBottomLeftButton.y = this.cropTopButton.y + this.maxCropHeight;
}
this.cropBottomButton.y = this.cropBottomLeftButton.y;
this.cropLeftButton.x = this.cropBottomLeftButton.x;
break;
case this.cropBottomRightButton:
if(this.cropBottomRightButton.x > this.image.width)
{
this.cropBottomRightButton.x = this.image.width;
}
if(this.cropBottomRightButton.x < this.cropLeftButton.x)
{
this.cropBottomRightButton.x = this.cropLeftButton.x;
}
if(this.cropBottomRightButton.x - this.cropLeftButton.x > this.maxCropWidth)
{
this.cropBottomRightButton.x = this.cropLeftButton.x + this.maxCropWidth;
}
if(this.cropBottomRightButton.y > this.image.height)
{
this.cropBottomRightButton.y = this.image.height;
}
if(this.cropBottomRightButton.y < this.cropTopButton.y)
{
this.cropBottomRightButton.y = this.cropTopButton.y;
}
if(this.cropBottomRightButton.y - this.cropTopButton.y > this.maxCropHeight)
{
this.cropBottomRightButton.y = this.cropTopButton.y + this.maxCropHeight;
}
this.cropBottomButton.y = this.cropBottomRightButton.y;
this.cropRightButton.x = this.cropBottomRightButton.x;
}
this.setCropRect(this.cropLeftButton.x,this.cropTopButton.y,this.cropRightButton.x - this.cropLeftButton.x,this.cropBottomButton.y - this.cropTopButton.y);
}
private function dropCropButton(e:MouseEvent) : void
{
Main.stage.removeEventListener(MouseEvent.MOUSE_UP,this.dropCropButton);
Main.stage.removeEventListener(MouseEvent.MOUSE_MOVE,this.dragCropButton);
}
private function maximizeCropRect(e:MouseEvent) : void
{
Main.writeToConsole("maximizeCropRect");
this.setCropRect(0,0,this.image.width,this.image.height);
}
private function holdMoveButton(e:MouseEvent) : void
{
this.dragButton = e.target as Sprite;
this.holdPoint.x = this.moveButton.mouseX;
this.holdPoint.y = this.moveButton.mouseY;
Main.stage.addEventListener(MouseEvent.MOUSE_UP,this.dropMoveButton);
Main.stage.addEventListener(MouseEvent.MOUSE_MOVE,this.dragMoveButton);
}
private function dragMoveButton(e:MouseEvent) : void
{
this.moveButton.x += this.moveButton.mouseX - this.holdPoint.x;
this.moveButton.y += this.moveButton.mouseY - this.holdPoint.y;
if(this.moveButton.x < 0)
{
this.moveButton.x = 0;
}
if(this.moveButton.y < 0)
{
this.moveButton.y = 0;
}
if(this.moveButton.x + this.moveButton.width > this.image.width)
{
this.moveButton.x = this.image.width - this.moveButton.width;
}
if(this.moveButton.y + this.moveButton.height > this.image.height)
{
this.moveButton.y = this.image.height - this.moveButton.height;
}
this.setCropRect(this.moveButton.x,this.moveButton.y,this.moveButton.width,this.moveButton.height,false);
}
private function dropMoveButton(e:MouseEvent) : void
{
Main.stage.removeEventListener(MouseEvent.MOUSE_UP,this.dropMoveButton);
Main.stage.removeEventListener(MouseEvent.MOUSE_MOVE,this.dragMoveButton);
}
public function get cropRectangle() : Rectangle
{
var fullSizeRect:Rectangle = this.cropRect.clone();
fullSizeRect.x /= this.k;
fullSizeRect.y /= this.k;
fullSizeRect.width /= this.k;
fullSizeRect.height /= this.k;
return fullSizeRect;
}
}
}
|
package alternativa.resource
{
import alternativa.osgi.service.loader.ILoaderService;
import alternativa.osgi.service.log.LogLevel;
import alternativa.resource.factory.IResourceFactory;
import alternativa.service.IResourceService;
import alternativa.tanks.loader.ILoaderWindowService;
import alternativa.types.Long;
import alternativa.types.LongFactory;
import flash.events.ErrorEvent;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.ProgressEvent;
import flash.utils.ByteArray;
import flash.utils.Dictionary;
[Event(name="complete",type="flash.events.Event")]
[Event(name="error",type="flash.events.ErrorEvent")]
public class BatchResourceLoader extends EventDispatcher
{
private var resources:Array;
private var _batchId:int;
private var levelIndex:int;
private var levelResources:Array;
private var resourceIndex:int;
private var resourcesTotalNum:int;
private var resourcesLoadedNum:int;
private var resourceById:Dictionary;
private var resourceRegister:IResourceService;
private var loaderWindowService:ILoaderWindowService;
private var loaderService:ILoaderService;
private var currResource:Resource;
public function BatchResourceLoader(batchId:int, resources:Array)
{
super();
this._batchId = batchId;
this.resources = resources;
this.resourceById = new Dictionary();
this.resourceRegister = null;
}
public function get batchId() : int
{
return this._batchId;
}
public function load() : void
{
}
public function close() : void
{
this.currResource.close();
}
private function loadLevel() : void
{
this.levelResources = this.resources[this.levelIndex];
this.resourceIndex = this.levelResources.length - 1;
this.loadResource();
}
private function loadResource() : void
{
var resourceFactory:IResourceFactory = null;
var url:String = null;
var resourceInfo:ResourceInfo = ResourceInfo(this.levelResources[this.resourceIndex]);
if(this.resourceRegister.getResource(resourceInfo.id) != null)
{
this.log(LogLevel.LOG_ERROR,"An attemt to load an existing resource occurred. Resource id=" + resourceInfo.id);
this.loaderService.loadingProgress.startProgress(resourceInfo.id);
this.loaderService.loadingProgress.stopProgress(resourceInfo.id);
this.onResourceLoaded(null);
}
else
{
resourceFactory = this.resourceRegister.getResourceFactory(resourceInfo.type);
if(resourceFactory == null)
{
this.onResourceLoadingError(new ErrorEvent(ErrorEvent.ERROR,false,false,"Factory not found. Resource type=" + resourceInfo.type + ", resource id=" + resourceInfo.id));
}
this.currResource = resourceFactory.createResource(resourceInfo.type);
if(this.currResource == null)
{
this.onResourceLoadingError(new ErrorEvent(ErrorEvent.ERROR,false,false,"Resource factory has returned null resource. Resource id=" + resourceInfo.id + ", resourceType=" + resourceInfo.type));
}
this.currResource.id = resourceInfo.id;
this.currResource.batchId = this.batchId;
this.currResource.isOptional = resourceInfo.isOptional;
this.resourceById[this.currResource.id] = this.currResource;
url = this.makeResourceUrl(resourceInfo.id,resourceInfo.version);
if(this.currResource.isOptional)
{
this.currResource.url = url;
this.resourceRegister.registerResource(this.currResource);
this.loaderService.loadingProgress.startProgress(this.currResource.id);
this.loaderService.loadingProgress.stopProgress(this.currResource.id);
this.onResourceLoaded(null);
}
else
{
this.currResource.addEventListener(Event.COMPLETE,this.onResourceLoaded);
this.currResource.addEventListener(ErrorEvent.ERROR,this.onResourceLoadingError);
this.currResource.addEventListener(ProgressEvent.PROGRESS,this.onResourceLoadingProgress);
this.currResource.load(url);
this.loaderService.loadingProgress.startProgress(this.currResource.id);
this.loaderService.loadingProgress.setStatus(this.currResource.id,"Loading resource " + (this.resourcesLoadedNum + 1) + "/" + this.resourcesTotalNum);
}
}
}
private function makeResourceUrl(id:Long, version:Long) : String
{
var url:String = null;
var longId:ByteArray = LongFactory.LongToByteArray(id);
url += "/" + longId.readUnsignedInt().toString(8);
url += "/" + longId.readUnsignedShort().toString(8);
url += "/" + longId.readUnsignedByte().toString(8);
url += "/" + longId.readUnsignedByte().toString(8);
url += "/";
var longVersion:ByteArray = LongFactory.LongToByteArray(version);
var versHigh:int = longVersion.readUnsignedInt();
var versLow:int = longVersion.readUnsignedInt();
if(versHigh != 0)
{
url += versHigh.toString(8);
}
return url + (versLow.toString(8) + "/");
}
private function onResourceLoadingProgress(e:ProgressEvent) : void
{
var resource:Resource = Resource(e.target);
this.loaderService.loadingProgress.setStatus(resource.id,"Loading resource " + (this.resourcesLoadedNum + 1) + "/" + this.resourcesTotalNum + " (" + e.bytesTotal + " bytes)");
this.loaderService.loadingProgress.setProgress(resource.id,e.bytesLoaded / e.bytesTotal);
}
private function onResourceLoaded(e:Event) : void
{
var resource:Resource = null;
++this.resourcesLoadedNum;
if(e != null)
{
resource = Resource(e.target);
resource.removeEventListener(Event.COMPLETE,this.onResourceLoaded);
resource.removeEventListener(ErrorEvent.ERROR,this.onResourceLoadingError);
resource.removeEventListener(ProgressEvent.PROGRESS,this.onResourceLoadingProgress);
this.resourceRegister.registerResource(resource);
this.loaderService.loadingProgress.stopProgress(resource.id);
}
if(this.resourceIndex > 0)
{
--this.resourceIndex;
this.loadResource();
}
else if(this.levelIndex > 0)
{
--this.levelIndex;
this.loadLevel();
}
else
{
this.currResource = null;
if(hasEventListener(Event.COMPLETE))
{
dispatchEvent(new Event(Event.COMPLETE));
}
}
}
private function onResourceLoadingError(e:ErrorEvent) : void
{
var message:String = null;
if(hasEventListener(ErrorEvent.ERROR))
{
message = "Resource loading error. Batch id=" + this._batchId + ". " + e.text;
dispatchEvent(new ErrorEvent(ErrorEvent.ERROR,false,false,message));
}
}
private function log(logLevel:int, message:String) : void
{
}
}
}
|
package alternativa.tanks.view.battlelist.battleitem.renderer.unavailable {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.view.battlelist.battleitem.renderer.unavailable.CellUnavailableSelected_normalRight.png")]
public class CellUnavailableSelected_normalRight extends BitmapAsset {
public function CellUnavailableSelected_normalRight() {
super();
}
}
}
|
package _codec.projects.tanks.client.battlefield.models.tankparts.weapon.turret {
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.battlefield.models.tankparts.weapon.turret.RotatingTurretCC;
import projects.tanks.client.battlefield.models.user.tank.commands.TurretStateCommand;
public class CodecRotatingTurretCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_turretState:ICodec;
public function CodecRotatingTurretCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_turretState = param1.getCodec(new TypeCodecInfo(TurretStateCommand,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:RotatingTurretCC = new RotatingTurretCC();
local2.turretState = this.codec_turretState.decode(param1) as TurretStateCommand;
return local2;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:RotatingTurretCC = RotatingTurretCC(param2);
this.codec_turretState.encode(param1,local3.turretState);
}
}
}
|
package projects.tanks.client.battlefield.models.tankparts.sfx.shoot.shaft {
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 ShaftShootSFXModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var model:IModel;
public function ShaftShootSFXModelServer(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 platform.client.fp10.core.type.impl {
import alternativa.types.Long;
import platform.client.fp10.core.type.IGameClass;
import platform.client.fp10.core.type.IGameObject;
import platform.client.fp10.core.type.ISpace;
public class NotLoadedGameObject implements IGameObject {
private var _id:Long;
private var _space:ISpace;
public function NotLoadedGameObject(param1:Long, param2:ISpace) {
super();
this._id = param1;
this._space = param2;
}
public function get id() : Long {
return this._id;
}
public function get name() : String {
throw new Error("Object not loaded, id = " + this._id);
}
public function get gameClass() : IGameClass {
throw new Error("Object not loaded, id = " + this._id);
}
public function get space() : ISpace {
return this._space;
}
public function hasModel(param1:Class) : Boolean {
return false;
}
public function adapt(param1:Class) : Object {
throw new Error("Object not loaded, id = " + this._id);
}
public function event(param1:Class) : Object {
throw new Error("Object not loaded, id = " + this._id);
}
}
}
|
package alternativa.tanks.models.statistics {
import projects.tanks.client.battleservice.model.statistics.UserReward;
[ModelInterface]
public interface IStatisticRound {
function roundStart() : void;
function roundFinish(param1:Boolean, param2:Boolean, param3:int, param4:Vector.<UserReward>) : void;
function roundStop() : void;
}
}
|
package alternativa.tanks.bg {
import flash.geom.Rectangle;
public interface IBackgroundService {
function showBg() : void;
function hideBg() : void;
function drawBg(param1:Rectangle = null) : void;
}
}
|
package forms.ranks {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/forms.ranks.DefaultRanksBitmaps_bitmapSmallRank05.png")]
public class DefaultRanksBitmaps_bitmapSmallRank05 extends BitmapAsset {
public function DefaultRanksBitmaps_bitmapSmallRank05() {
super();
}
}
}
|
package _codec.projects.tanks.client.chat.models.chat.chat {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import projects.tanks.client.chat.models.chat.chat.ChatAddressMode;
public class CodecChatAddressMode implements ICodec {
public function CodecChatAddressMode() {
super();
}
public function init(param1:IProtocol) : void {
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:ChatAddressMode = null;
var local3:int = int(param1.reader.readInt());
switch(local3) {
case 0:
local2 = ChatAddressMode.PUBLIC_TO_ALL;
break;
case 1:
local2 = ChatAddressMode.PUBLIC_ADDRESSED;
break;
case 2:
local2 = ChatAddressMode.PRIVATE;
}
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 _codec.projects.tanks.client.battleselect.model.matchmaking.group.notify {
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.battleselect.model.matchmaking.group.notify.MatchmakingGroupCC;
import projects.tanks.client.battleselect.model.matchmaking.group.notify.MatchmakingUserData;
public class CodecMatchmakingGroupCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_users:ICodec;
public function CodecMatchmakingGroupCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_users = param1.getCodec(new CollectionCodecInfo(new TypeCodecInfo(MatchmakingUserData,false),false,1));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:MatchmakingGroupCC = new MatchmakingGroupCC();
local2.users = this.codec_users.decode(param1) as Vector.<MatchmakingUserData>;
return local2;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:MatchmakingGroupCC = MatchmakingGroupCC(param2);
this.codec_users.encode(param1,local3.users);
}
}
}
|
package projects.tanks.client.clans.license.user {
public interface ILicenseClanUserModelBase {
function addClanLicense() : void;
function removeClanLicense() : void;
}
}
|
package alternativa.tanks.service.panel {
import alternativa.tanks.gui.panel.MainPanel;
import flash.events.EventDispatcher;
import projects.tanks.clients.fp10.libraries.tanksservices.service.alertservices.IAlertService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.logging.gamescreen.UserChangeGameScreenService;
import services.alertservice.AlertAnswer;
public class PanelView extends EventDispatcher implements IPanelView {
[Inject]
public static var alertService:IAlertService;
[Inject]
public static var userChangeGameScreenService:UserChangeGameScreenService;
private var panel:MainPanel;
public function PanelView() {
super();
}
public function setPanel() : void {
this.panel = new MainPanel();
dispatchEvent(new PanelInitedEvent());
}
public function getPanel() : MainPanel {
return this.panel;
}
public function lock() : void {
this.panel.mouseEnabled = false;
this.panel.mouseChildren = false;
}
public function unlock() : void {
this.panel.mouseEnabled = true;
this.panel.mouseChildren = true;
}
public function showAlert(param1:String) : void {
alertService.showAlert(param1,Vector.<String>([AlertAnswer.OK]));
}
}
}
|
package alternativa.tanks.models.weapon.shaft
{
public class ShaftData
{
public var maxEnergy:Number;
public var chargeRate:Number;
public var dischargeRate:Number;
public var elevationAngleUp:Number;
public var elevationAngleDown:Number;
public var verticalTargetingSpeed:Number;
public var horizontalTargetingSpeed:Number;
public var initialFOV:Number;
public var minimumFOV:Number;
public var shrubsHidingRadiusMin:Number;
public var shrubsHidingRadiusMax:Number;
public var impactQuickShot:Number;
public function ShaftData()
{
super();
}
}
}
|
package projects.tanks.clients.flash.resources.resource.loaders.events {
import flash.events.Event;
public class LoaderEvent extends Event {
public static const PART_OPEN:String = "partOpen";
public static const PART_COMPLETE:String = "partComplete";
private var _partsTotal:int;
private var _currentPart:int;
public function LoaderEvent(param1:String, param2:int, param3:int) {
super(param1);
this._partsTotal = param2;
this._currentPart = param3;
}
public function get partsTotal() : int {
return this._partsTotal;
}
public function get currentPart() : int {
return this._currentPart;
}
override public function clone() : Event {
return new LoaderEvent(type,this._partsTotal,this._currentPart);
}
override public function toString() : String {
return "[LoaderEvent type=" + type + ", partsTotal=" + this._partsTotal + ", currentPart=" + this._currentPart + "]";
}
}
}
|
package _codec.projects.tanks.client.battlefield.models.ultimate.effects.viking {
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.viking.VikingUltimateCC;
public class VectorCodecVikingUltimateCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecVikingUltimateCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(VikingUltimateCC,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.<VikingUltimateCC> = new Vector.<VikingUltimateCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = VikingUltimateCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:VikingUltimateCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<VikingUltimateCC> = Vector.<VikingUltimateCC>(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.panel.model.quest.daily {
import alternativa.types.Long;
public interface IDailyQuestShowingModelBase {
function openDailyQuest(param1:Vector.<DailyQuestInfo>) : void;
function prizeGiven(param1:Long) : void;
function skipQuest(param1:Long, param2:DailyQuestInfo) : void;
}
}
|
package alternativa.tanks.gui.shop.shopitems.item.garageitem {
import alternativa.tanks.gui.shop.shopitems.item.details.ShopItemDetails;
import alternativa.tanks.model.payment.shop.paint.PaintPackage;
import controls.base.LabelBase;
import forms.ColorConstants;
import platform.client.fp10.core.type.IGameObject;
public class PaintPackageDescriptionView extends ShopItemDetails {
private static const WIDTH:int = 250;
public function PaintPackageDescriptionView(param1:IGameObject) {
super(param1);
this.addDescription();
}
private function addDescription() : void {
var local1:LabelBase = null;
local1 = new LabelBase();
local1.multiline = true;
local1.wordWrap = true;
local1.color = ColorConstants.GREEN_TEXT;
local1.htmlText = PaintPackage(shopItemObject.adapt(PaintPackage)).getDescription();
local1.mouseWheelEnabled = false;
local1.width = WIDTH;
addChild(local1);
}
}
}
|
package alternativa.tanks.service.settings {
import flash.events.Event;
public class SettingsServiceEvent extends Event {
public static const SETTINGS_CHANGED:String = "SettingsServiceEvent.SETTINGS_CHANGED";
private var setting:SettingEnum;
public function SettingsServiceEvent(param1:String, param2:SettingEnum) {
super(param1,true,false);
this.setting = param2;
}
public function getSetting() : SettingEnum {
return this.setting;
}
}
}
|
package platform.client.fp10.core.resource.types {
import alternativa.osgi.OSGi;
import alternativa.osgi.service.launcherparams.ILauncherParams;
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.osgi.service.locale.LocaleService;
import alternativa.osgi.service.logging.LogService;
import alternativa.osgi.service.logging.Logger;
import alternativa.protocol.IProtocol;
import alternativa.startup.CacheURLLoader;
import alternativa.types.URL;
import flash.display.BitmapData;
import flash.events.ErrorEvent;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import flash.utils.ByteArray;
import platform.client.core.general.resourcelocale.format.ImagePair;
import platform.client.core.general.resourcelocale.format.LocalizedFileFormat;
import platform.client.core.general.resourcelocale.format.StringPair;
import platform.client.fp10.core.resource.BatchImageConstructor;
public class LocalizationLoader {
private var localeService:ILocaleService;
private var localeStruct:LocalizedFileFormat;
private var batchImageConstructor:BatchImageConstructor;
private var localizationLogger:Logger;
protected var loadCompleteHandler:Function;
private var urlParams:ILauncherParams;
public function LocalizationLoader(param1:ILauncherParams) {
super();
var local2:OSGi = OSGi.getInstance();
this.urlParams = param1;
var local3:String = param1.getParameter("lang","en");
this.localeService = new LocaleService(local3,"en");
local2.registerService(ILocaleService,this.localeService);
this.localizationLogger = local2.getService(LogService).getLogger("localization");
}
public function load(param1:Function) : void {
this.loadCompleteHandler = param1;
this.loadMeta();
}
private function loadMeta() : void {
var local1:String = this.getLocalizationRootUrl() + "meta.json?rand=" + Math.random();
var local2:URLLoader = new URLLoader();
local2.dataFormat = URLLoaderDataFormat.BINARY;
local2.addEventListener(Event.COMPLETE,this.onLoadMetaComplete);
local2.addEventListener(IOErrorEvent.IO_ERROR,this.onLoadingError);
local2.addEventListener(SecurityErrorEvent.SECURITY_ERROR,this.onLoadingError);
local2.load(new URLRequest(local1));
}
private function getLocalizationRootUrl() : String {
var local4:String = null;
var local1:String = this.urlParams.getParameter("resources");
var local2:int = int(local1.indexOf("resources/"));
var local3:String = local2 == -1 ? local1 : local1.substr(0,local2);
if(local3.indexOf("://") == -1) {
local4 = new URL(this.urlParams.urlLoader,this.urlParams.isStrictUseHttp()).scheme;
local3 = local4 + "://" + local3;
}
if(local3.lastIndexOf("/") != local3.length - 1) {
local3 += "/";
}
return local3 + "localization/";
}
private function onLoadMetaComplete(param1:Event) : void {
var local2:Object = JSON.parse(unescape(param1.target.data));
var local3:String = local2[this.localeService.language.toUpperCase() + ".l18n"];
this.loadData(this.getLocalizationRootUrl() + local3);
}
private function loadData(param1:String) : void {
var local2:CacheURLLoader = new CacheURLLoader();
local2.dataFormat = URLLoaderDataFormat.BINARY;
local2.addEventListener(Event.COMPLETE,this.onLoadingComplete);
local2.addEventListener(IOErrorEvent.IO_ERROR,this.onLoadingError);
local2.addEventListener(SecurityErrorEvent.SECURITY_ERROR,this.onLoadingError);
local2.load(new URLRequest(param1));
}
protected function onLoadingComplete(param1:Event) : void {
var local2:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
this.localeStruct = local2.decode(LocalizedFileFormat,URLLoader(param1.target).data);
this.registerValues();
}
private function onLoadingError(param1:ErrorEvent) : void {
this.localizationLogger.error("Localization not loaded: " + param1.errorID + ", " + param1.text);
}
private function registerValues() : void {
var local1:StringPair = null;
if(this.localeStruct.strings != null) {
for each(local1 in this.localeStruct.strings) {
this.localeService.setText(local1.key,local1.value);
}
}
if(this.localeStruct.images != null && this.localeStruct.images.length > 0) {
this.createImages();
}
this.loadCompleteHandler();
}
private function createImages() : void {
var local2:ImagePair = null;
var local1:Vector.<ByteArray> = new Vector.<ByteArray>();
for each(local2 in this.localeStruct.images) {
local1.push(local2.value);
}
this.batchImageConstructor = new BatchImageConstructor();
this.batchImageConstructor.addEventListener(Event.COMPLETE,this.onImagesComplete);
this.batchImageConstructor.buildImages(local1,5);
}
private function onImagesComplete(param1:Event) : void {
var local2:Vector.<BitmapData> = this.batchImageConstructor.images;
this.batchImageConstructor = null;
var local3:Vector.<ImagePair> = this.localeStruct.images;
var local4:int = 0;
while(local4 < local2.length) {
this.localeService.setImage(local3[local4].key,local2[local4]);
local4++;
}
}
}
}
|
package projects.tanks.client.tanksservices.model.notifier.socialnetworks {
import projects.tanks.client.tanksservices.model.notifier.AbstractNotifier;
public class SNUidNotifierData extends AbstractNotifier {
private var _snUid:String;
public function SNUidNotifierData(param1:String = null) {
super();
this._snUid = param1;
}
public function get snUid() : String {
return this._snUid;
}
public function set snUid(param1:String) : void {
this._snUid = param1;
}
override public function toString() : String {
var local1:String = "SNUidNotifierData [";
local1 += "snUid = " + this.snUid + " ";
local1 += super.toString();
return local1 + "]";
}
}
}
|
package alternativa.tanks.servermodels {
import projects.tanks.client.entrance.model.entrance.google.GoogleEntranceModelBase;
import projects.tanks.client.entrance.model.entrance.google.IGoogleEntranceModelBase;
[ModelInfo]
public class GoogleEntranceModel extends GoogleEntranceModelBase implements IGoogleEntranceModelBase, IGoogleEntranceModel {
public function GoogleEntranceModel() {
super();
}
public function login(param1:String) : void {
server.login(param1);
}
}
}
|
package controls.rangicons
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class RangIcon_p12 extends BitmapAsset
{
public function RangIcon_p12()
{
super();
}
}
}
|
package projects.tanks.clients.fp10.libraries.tanksservices.model.uidcheck {
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class UidCheckServiceEvents implements UidCheckService {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function UidCheckServiceEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function getMaxLength() : int {
var result:int = 0;
var i:int = 0;
var m:UidCheckService = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = UidCheckService(this.impl[i]);
result = int(m.getMaxLength());
i++;
}
}
finally {
Model.popObject();
}
return result;
}
public function exist(param1:String, param2:Function) : void {
var i:int = 0;
var m:UidCheckService = null;
var uid:String = param1;
var callback:Function = param2;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = UidCheckService(this.impl[i]);
m.exist(uid,callback);
i++;
}
}
finally {
Model.popObject();
}
}
public function validate(param1:String, param2:Function) : void {
var i:int = 0;
var m:UidCheckService = null;
var uid:String = param1;
var callback:Function = param2;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = UidCheckService(this.impl[i]);
m.validate(uid,callback);
i++;
}
}
finally {
Model.popObject();
}
}
}
}
|
package projects.tanks.clients.fp10.libraries.tanksservices.service.notifier.online {
import alternativa.types.Long;
import flash.events.EventDispatcher;
import flash.utils.Dictionary;
import platform.client.fp10.core.network.connection.ConnectionCloseStatus;
import platform.client.fp10.core.network.handler.OnConnectionClosedServiceListener;
import projects.tanks.clients.fp10.libraries.tanksservices.model.notifier.online.ClientOnlineNotifierData;
public class OnlineNotifierService extends EventDispatcher implements IOnlineNotifierService, OnConnectionClosedServiceListener {
private var usersOnlineStatus:Dictionary = new Dictionary();
public function OnlineNotifierService() {
super();
}
public function onConnectionClosed(param1:ConnectionCloseStatus) : void {
this.usersOnlineStatus = new Dictionary();
}
public function setOnline(param1:Vector.<ClientOnlineNotifierData>) : void {
dispatchEvent(new OnlineNotifierServiceEvent(OnlineNotifierServiceEvent.SET_ONLINE,param1));
}
public function addUserOnlineData(param1:ClientOnlineNotifierData) : void {
this.usersOnlineStatus[param1.userId] = param1;
}
public function removeUserOnlineData(param1:Long) : void {
delete this.usersOnlineStatus[param1];
}
public function hasUserOnlineData(param1:Long) : Boolean {
return param1 in this.usersOnlineStatus;
}
public function getUserOnlineData(param1:Long) : ClientOnlineNotifierData {
return this.usersOnlineStatus[param1];
}
}
}
|
package projects.tanks.client.battleselect.model.matchmaking.group.invitewindow {
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 GroupInviteWindowModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var _getFriendsId:Long = Long.getLong(1542332548,143696840);
private var _prepareToShowId:Long = Long.getLong(1793633202,2075745526);
private var model:IModel;
public function GroupInviteWindowModelServer(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 getFriends() : 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._getFriendsId,this.protocolBuffer);
var local2:IGameObject = Model.object;
var local3:ISpace = local2.space;
local3.commandSender.sendCommand(local1);
this.protocolBuffer.optionalMap.clear();
}
public function prepareToShow() : 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._prepareToShowId,this.protocolBuffer);
var local2:IGameObject = Model.object;
var local3:ISpace = local2.space;
local3.commandSender.sendCommand(local1);
this.protocolBuffer.optionalMap.clear();
}
}
}
|
package alternativa.tanks.gui.friends.battleinvite {
import alternativa.types.Long;
import controls.base.LabelBase;
import forms.ColorConstants;
import forms.userlabel.UserLabel;
import projects.tanks.clients.flash.commons.services.notification.Notification;
public class ResponseBattleInviteNotification extends Notification {
private var _messageLabel:LabelBase;
private var _userLabel:UserLabel;
public function ResponseBattleInviteNotification(param1:Long, param2:String) {
super(param1,param2);
}
override protected function init() : void {
super.init();
this._userLabel = new UserLabel(userId);
addChild(this._userLabel);
this._messageLabel = new LabelBase();
this._messageLabel.mouseEnabled = false;
addChild(this._messageLabel);
this._messageLabel.color = ColorConstants.GREEN_LABEL;
this._messageLabel.text = message;
}
override protected function resize() : void {
this._userLabel.x = GAP + 7;
this._userLabel.y = GAP + 5;
this._messageLabel.x = GAP + 9;
this._messageLabel.y = this._userLabel.y + this._userLabel.height - 1;
_innerHeight = this._messageLabel.y + this._messageLabel.height - 3;
var local1:int = this._messageLabel.x + this._messageLabel.width + GAP * 2;
if(local1 > _width) {
_width = local1;
}
_height = _innerHeight + GAP * 2 + 1;
super.resize();
}
}
}
|
package projects.tanks.client.partners.impl.steam {
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 SteamLoginModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var model:IModel;
public function SteamLoginModelServer(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 forms.buttons
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class MainPanelGoldenButton_normalBtn extends BitmapAsset
{
public function MainPanelGoldenButton_normalBtn()
{
super();
}
}
}
|
package controls.buttons.h71px {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/controls.buttons.h71px.GreyHugeButtonSkin_middleUpClass.png")]
public class GreyHugeButtonSkin_middleUpClass extends BitmapAsset {
public function GreyHugeButtonSkin_middleUpClass() {
super();
}
}
}
|
package alternativa.tanks.model.referrals.notifier {
import alternativa.tanks.service.referrals.notification.NewReferralsNotifierService;
import alternativa.tanks.service.referrals.notification.NewReferralsNotifierServiceEvent;
import platform.client.fp10.core.model.ObjectLoadPostListener;
import platform.client.fp10.core.model.ObjectUnloadListener;
import projects.tanks.client.panel.model.referrals.notification.INewReferralsNotifierModelBase;
import projects.tanks.client.panel.model.referrals.notification.NewReferralsNotifierModelBase;
[ModelInfo]
public class NewReferralsNotifierModel extends NewReferralsNotifierModelBase implements INewReferralsNotifierModelBase, ObjectLoadPostListener, ObjectUnloadListener {
[Inject]
public static var newReferralsNotifierService:NewReferralsNotifierService;
public function NewReferralsNotifierModel() {
super();
}
public function objectLoadedPost() : void {
newReferralsNotifierService.addEventListener(NewReferralsNotifierServiceEvent.REQUEST_NEW_REFERRALS_COUNT,getFunctionWrapper(this.requestNewReferralsCount));
newReferralsNotifierService.addEventListener(NewReferralsNotifierServiceEvent.RESET_NEW_REFERRALS_COUNT,getFunctionWrapper(this.resetNewReferralsCount));
}
private function resetNewReferralsCount(param1:NewReferralsNotifierServiceEvent) : void {
server.resetNewReferralsCount();
}
private function requestNewReferralsCount(param1:NewReferralsNotifierServiceEvent) : void {
server.requestNewReferralsCount();
}
public function objectUnloaded() : void {
newReferralsNotifierService.removeEventListener(NewReferralsNotifierServiceEvent.REQUEST_NEW_REFERRALS_COUNT,getFunctionWrapper(this.requestNewReferralsCount));
newReferralsNotifierService.removeEventListener(NewReferralsNotifierServiceEvent.RESET_NEW_REFERRALS_COUNT,getFunctionWrapper(this.resetNewReferralsCount));
}
public function notifyReferralAdded(param1:int) : void {
newReferralsNotifierService.notifyReferralAdded(param1);
}
public function notifyNewReferralsCountUpdated(param1:int) : void {
newReferralsNotifierService.newReferralsCountUpdated(param1);
}
}
}
|
package alternativa.tanks.gui.tankpreview {
import alternativa.engine3d.containers.KDContainer;
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.materials.TextureMaterial;
import alternativa.engine3d.objects.Mesh;
import alternativa.tanks.service.garage.GarageService;
import flash.geom.Vector3D;
import projects.tanks.clients.flash.resources.resource.Tanks3DSResource;
import projects.tanks.clients.flash.resources.tanks.Tank3D;
import projects.tanks.clients.fp10.libraries.tanksservices.service.layout.ILobbyLayoutService;
public class EventTankPreview extends TankPreviewWindow {
[Inject]
public static var lobbyLayoutService:ILobbyLayoutService;
[Inject]
public static var garageService:GarageService;
public function EventTankPreview() {
super();
}
private function createTank() : void {
tank = new Tank3D();
tank.x = -75;
tank.y = -50;
tank.z = 150;
}
override protected function addGarageObjectsToScene(param1:Tanks3DSResource) : void {
var local5:Mesh = null;
var local6:TextureMaterial = null;
camera.x = 0;
var local2:int = int(param1.objects.length);
var local3:Vector.<Object3D> = new Vector.<Object3D>();
var local4:int = 0;
while(local4 < local2) {
local5 = param1.objects[local4] as Mesh;
if(local5 != null) {
local5.setParent(null);
local6 = TextureMaterial(local5.faceList.material);
local6.texture = param1.getTextureForObject(local4);
local5.setMaterialToAllFaces(local6);
local5.sorting = 2;
local3.push(local5);
}
local4++;
}
kdTree = new KDContainer();
kdTree.x = 70;
kdTree.y = 50;
kdTree.z = -140;
kdTree.createTree(local3);
this.createTank();
createDrone(new Vector3D(150,-150,100));
kdTree.addChild(tank);
tank.addChild(drone);
hangarContainer.addChild(kdTree);
}
override protected function createScene() : void {
}
}
}
|
package assets.icons {
import flash.display.BitmapData;
[Embed(source="/_assets/assets.icons.play_icons_RED.png")]
public dynamic class play_icons_RED extends BitmapData {
public function play_icons_RED(param1:int = 46, param2:int = 26) {
super(param1,param2);
}
}
}
|
package _codec.projects.tanks.client.garage.models.shopabonement {
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 projects.tanks.client.commons.types.ShopCategoryEnum;
import projects.tanks.client.garage.models.shopabonement.ShopAbonementCC;
public class CodecShopAbonementCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_shopCategory:ICodec;
public function CodecShopAbonementCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_shopCategory = param1.getCodec(new EnumCodecInfo(ShopCategoryEnum,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:ShopAbonementCC = new ShopAbonementCC();
local2.shopCategory = this.codec_shopCategory.decode(param1) as ShopCategoryEnum;
return local2;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:ShopAbonementCC = ShopAbonementCC(param2);
this.codec_shopCategory.encode(param1,local3.shopCategory);
}
}
}
|
package projects.tanks.client.battlefield.models.tankparts.weapon.streamweapon {
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 StreamWeaponModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var model:IModel;
public function StreamWeaponModelServer(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.clan.incomingnotificator {
import alternativa.tanks.models.service.ClanNotificationEvent;
import alternativa.tanks.models.service.ClanNotificationsManager;
import alternativa.tanks.models.user.IClanUserModel;
import alternativa.types.Long;
import platform.client.fp10.core.model.ObjectLoadListener;
import platform.client.fp10.core.model.ObjectUnloadListener;
import projects.tanks.client.clans.clan.incomingnotificator.ClanIncomingNotificatorModelBase;
import projects.tanks.client.clans.clan.incomingnotificator.IClanIncomingNotificatorModelBase;
[ModelInfo]
public class ClanIncomingNotificatorModel extends ClanIncomingNotificatorModelBase implements ObjectLoadListener, ObjectUnloadListener, IClanIncomingNotificatorModelBase {
public function ClanIncomingNotificatorModel() {
super();
}
public function onAdding(param1:Long) : void {
if(!this.isServiceSpace()) {
return;
}
ClanNotificationsManager.onIncomingNotification(param1);
}
public function onRemoved(param1:Long) : void {
if(!this.isServiceSpace()) {
return;
}
ClanNotificationsManager.onRemoveIncomingNotification(param1);
}
public function objectLoaded() : void {
if(!this.isServiceSpace()) {
return;
}
ClanNotificationsManager.initializeIncomingNotifications(getInitParam().objects);
ClanNotificationsManager.dispatcher.addEventListener(ClanNotificationEvent.REMOVE_INCOMING_NOTIFICATION,getFunctionWrapper(this.onServerRemove));
}
private function onServerRemove(param1:ClanNotificationEvent) : void {
server.remove(param1.id);
}
public function objectUnloaded() : void {
if(!this.isServiceSpace()) {
return;
}
ClanNotificationsManager.dispatcher.removeEventListener(ClanNotificationEvent.REMOVE_INCOMING_NOTIFICATION,getFunctionWrapper(this.onServerRemove));
}
private function isServiceSpace() : Boolean {
return IClanUserModel(object.adapt(IClanUserModel)).loadingInServiceSpace();
}
}
}
|
package alternativa.tanks.gui {
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import platform.client.fp10.core.resource.types.ImageResource;
import utils.preview.IImageResource;
import utils.preview.ImageResourceLoadingWrapper;
public class PreviewBonusItem extends Sprite implements IImageResource {
private var _imageResource:ImageResource;
private var _preview:Bitmap;
private var _componentWidth:Number;
private var _componentHeight:Number;
public function PreviewBonusItem(param1:ImageResource, param2:Number, param3:Number) {
super();
this._imageResource = param1;
this._componentWidth = param2;
this._componentHeight = param3;
this.init();
}
private function init() : void {
graphics.clear();
graphics.beginFill(16711680,0);
graphics.drawRect(0,0,this._componentWidth,this._componentHeight);
graphics.endFill();
if(this._imageResource.isLazy && !this._imageResource.isLoaded) {
this._imageResource.loadLazyResource(new ImageResourceLoadingWrapper(this));
} else {
this.setPreview(this._imageResource.data);
}
}
public function setPreviewResource(param1:ImageResource) : void {
if(this._imageResource.id == param1.id) {
this.setPreview(this._imageResource.data);
}
}
private function setPreview(param1:BitmapData) : void {
if(this._preview != null && this.contains(this._preview)) {
removeChild(this._preview);
}
this._preview = new Bitmap(param1);
addChild(this._preview);
this._preview.x = this._componentWidth - this._preview.width >> 1;
this._preview.y = this._componentHeight - this._preview.height >> 1;
}
}
}
|
package _codec.projects.tanks.client.panel.model.quest.daily {
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.quest.daily.DailyQuestShowingCC;
public class CodecDailyQuestShowingCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_hasNewQuests:ICodec;
private var codec_timeToNextQuest:ICodec;
public function CodecDailyQuestShowingCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_hasNewQuests = param1.getCodec(new TypeCodecInfo(Boolean,false));
this.codec_timeToNextQuest = param1.getCodec(new TypeCodecInfo(int,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:DailyQuestShowingCC = new DailyQuestShowingCC();
local2.hasNewQuests = this.codec_hasNewQuests.decode(param1) as Boolean;
local2.timeToNextQuest = this.codec_timeToNextQuest.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:DailyQuestShowingCC = DailyQuestShowingCC(param2);
this.codec_hasNewQuests.encode(param1,local3.hasNewQuests);
this.codec_timeToNextQuest.encode(param1,local3.timeToNextQuest);
}
}
}
|
package alternativa.engine3d.core {
import alternativa.engine3d.alternativa3d;
import flash.geom.Vector3D;
import flash.utils.Dictionary;
use namespace alternativa3d;
public class EllipsoidCollider {
public var radiusX:Number;
public var radiusY:Number;
public var radiusZ:Number;
public var threshold:Number = 0.001;
private var matrix:Object3D = new Object3D();
private var faces:Vector.<Face> = new Vector.<Face>();
private var facesLength:int;
private var radius:Number;
private var src:Vector3D = new Vector3D();
private var displ:Vector3D = new Vector3D();
private var dest:Vector3D = new Vector3D();
private var collisionPoint:Vector3D = new Vector3D();
private var collisionPlane:Vector3D = new Vector3D();
private var vCenter:Vector3D = new Vector3D();
private var vA:Vector3D = new Vector3D();
private var vB:Vector3D = new Vector3D();
private var vC:Vector3D = new Vector3D();
private var vD:Vector3D = new Vector3D();
public function EllipsoidCollider(param1:Number, param2:Number, param3:Number) {
super();
this.radiusX = param1;
this.radiusY = param2;
this.radiusZ = param3;
}
private function prepare(param1:Vector3D, param2:Vector3D, param3:Object3D, param4:Dictionary, param5:Boolean) : void {
var local6:Number = NaN;
this.radius = this.radiusX;
if(this.radiusY > this.radius) {
this.radius = this.radiusY;
}
if(this.radiusZ > this.radius) {
this.radius = this.radiusZ;
}
this.matrix.scaleX = this.radiusX / this.radius;
this.matrix.scaleY = this.radiusY / this.radius;
this.matrix.scaleZ = this.radiusZ / this.radius;
this.matrix.x = param1.x;
this.matrix.y = param1.y;
this.matrix.z = param1.z;
this.matrix.alternativa3d::composeMatrix();
this.matrix.alternativa3d::invertMatrix();
this.src.x = 0;
this.src.y = 0;
this.src.z = 0;
this.displ.x = this.matrix.alternativa3d::ma * param2.x + this.matrix.alternativa3d::mb * param2.y + this.matrix.alternativa3d::mc * param2.z;
this.displ.y = this.matrix.alternativa3d::me * param2.x + this.matrix.alternativa3d::mf * param2.y + this.matrix.alternativa3d::mg * param2.z;
this.displ.z = this.matrix.alternativa3d::mi * param2.x + this.matrix.alternativa3d::mj * param2.y + this.matrix.alternativa3d::mk * param2.z;
this.dest.x = this.src.x + this.displ.x;
this.dest.y = this.src.y + this.displ.y;
this.dest.z = this.src.z + this.displ.z;
if(param5) {
this.vCenter.x = this.displ.x / 2;
this.vCenter.y = this.displ.y / 2;
this.vCenter.z = this.displ.z / 2;
local6 = this.radius + this.displ.length / 2;
} else {
this.vCenter.x = 0;
this.vCenter.y = 0;
this.vCenter.z = 0;
local6 = this.radius + this.displ.length;
}
this.vA.x = -local6;
this.vA.y = -local6;
this.vA.z = -local6;
this.vB.x = local6;
this.vB.y = -local6;
this.vB.z = -local6;
this.vC.x = local6;
this.vC.y = local6;
this.vC.z = -local6;
this.vD.x = -local6;
this.vD.y = local6;
this.vD.z = -local6;
param3.alternativa3d::composeAndAppend(this.matrix);
param3.alternativa3d::collectPlanes(this.vCenter,this.vA,this.vB,this.vC,this.vD,this.faces,param4);
this.facesLength = this.faces.length;
}
public function calculateDestination(param1:Vector3D, param2:Vector3D, param3:Object3D, param4:Dictionary = null) : Vector3D {
var local5:int = 0;
var local6:int = 0;
var local7:Number = NaN;
if(param2.length <= this.threshold) {
return param1.clone();
}
this.prepare(param1,param2,param3,param4,false);
if(this.facesLength > 0) {
local5 = 50;
local6 = 0;
while(local6 < local5) {
if(!this.checkCollision()) {
break;
}
local7 = this.radius + this.threshold + this.collisionPlane.w - this.dest.x * this.collisionPlane.x - this.dest.y * this.collisionPlane.y - this.dest.z * this.collisionPlane.z;
this.dest.x += this.collisionPlane.x * local7;
this.dest.y += this.collisionPlane.y * local7;
this.dest.z += this.collisionPlane.z * local7;
this.src.x = this.collisionPoint.x + this.collisionPlane.x * (this.radius + this.threshold);
this.src.y = this.collisionPoint.y + this.collisionPlane.y * (this.radius + this.threshold);
this.src.z = this.collisionPoint.z + this.collisionPlane.z * (this.radius + this.threshold);
this.displ.x = this.dest.x - this.src.x;
this.displ.y = this.dest.y - this.src.y;
this.displ.z = this.dest.z - this.src.z;
if(this.displ.length < this.threshold) {
break;
}
local6++;
}
this.faces.length = 0;
this.matrix.alternativa3d::composeMatrix();
return new Vector3D(this.matrix.alternativa3d::ma * this.dest.x + this.matrix.alternativa3d::mb * this.dest.y + this.matrix.alternativa3d::mc * this.dest.z + this.matrix.alternativa3d::md,this.matrix.alternativa3d::me * this.dest.x + this.matrix.alternativa3d::mf * this.dest.y + this.matrix.alternativa3d::mg * this.dest.z + this.matrix.alternativa3d::mh,this.matrix.alternativa3d::mi * this.dest.x + this.matrix.alternativa3d::mj * this.dest.y + this.matrix.alternativa3d::mk * this.dest.z + this.matrix.alternativa3d::ml);
}
return new Vector3D(param1.x + param2.x,param1.y + param2.y,param1.z + param2.z);
}
public function getCollision(param1:Vector3D, param2:Vector3D, param3:Vector3D, param4:Vector3D, param5:Object3D, param6:Dictionary = null) : Boolean {
var local7:Number = NaN;
var local8:Number = NaN;
var local9:Number = NaN;
var local10:Number = NaN;
var local11:Number = NaN;
var local12:Number = NaN;
var local13:Number = NaN;
var local14:Number = NaN;
var local15:Number = NaN;
var local16:Number = NaN;
var local17:Number = NaN;
var local18:Number = NaN;
if(param2.length <= this.threshold) {
return false;
}
this.prepare(param1,param2,param5,param6,true);
if(this.facesLength > 0) {
if(this.checkCollision()) {
this.matrix.alternativa3d::composeMatrix();
param3.x = this.matrix.alternativa3d::ma * this.collisionPoint.x + this.matrix.alternativa3d::mb * this.collisionPoint.y + this.matrix.alternativa3d::mc * this.collisionPoint.z + this.matrix.alternativa3d::md;
param3.y = this.matrix.alternativa3d::me * this.collisionPoint.x + this.matrix.alternativa3d::mf * this.collisionPoint.y + this.matrix.alternativa3d::mg * this.collisionPoint.z + this.matrix.alternativa3d::mh;
param3.z = this.matrix.alternativa3d::mi * this.collisionPoint.x + this.matrix.alternativa3d::mj * this.collisionPoint.y + this.matrix.alternativa3d::mk * this.collisionPoint.z + this.matrix.alternativa3d::ml;
if(this.collisionPlane.x < this.collisionPlane.y) {
if(this.collisionPlane.x < this.collisionPlane.z) {
local7 = 0;
local8 = -this.collisionPlane.z;
local9 = this.collisionPlane.y;
} else {
local7 = -this.collisionPlane.y;
local8 = this.collisionPlane.x;
local9 = 0;
}
} else if(this.collisionPlane.y < this.collisionPlane.z) {
local7 = this.collisionPlane.z;
local8 = 0;
local9 = -this.collisionPlane.x;
} else {
local7 = -this.collisionPlane.y;
local8 = this.collisionPlane.x;
local9 = 0;
}
local10 = this.collisionPlane.z * local8 - this.collisionPlane.y * local9;
local11 = this.collisionPlane.x * local9 - this.collisionPlane.z * local7;
local12 = this.collisionPlane.y * local7 - this.collisionPlane.x * local8;
local13 = this.matrix.alternativa3d::ma * local7 + this.matrix.alternativa3d::mb * local8 + this.matrix.alternativa3d::mc * local9;
local14 = this.matrix.alternativa3d::me * local7 + this.matrix.alternativa3d::mf * local8 + this.matrix.alternativa3d::mg * local9;
local15 = this.matrix.alternativa3d::mi * local7 + this.matrix.alternativa3d::mj * local8 + this.matrix.alternativa3d::mk * local9;
local16 = this.matrix.alternativa3d::ma * local10 + this.matrix.alternativa3d::mb * local11 + this.matrix.alternativa3d::mc * local12;
local17 = this.matrix.alternativa3d::me * local10 + this.matrix.alternativa3d::mf * local11 + this.matrix.alternativa3d::mg * local12;
local18 = this.matrix.alternativa3d::mi * local10 + this.matrix.alternativa3d::mj * local11 + this.matrix.alternativa3d::mk * local12;
param4.x = local15 * local17 - local14 * local18;
param4.y = local13 * local18 - local15 * local16;
param4.z = local14 * local16 - local13 * local17;
param4.normalize();
param4.w = param3.x * param4.x + param3.y * param4.y + param3.z * param4.z;
this.faces.length = 0;
return true;
}
this.faces.length = 0;
return false;
}
return false;
}
private function checkCollision() : Boolean {
var local4:Face = null;
var local5:Wrapper = null;
var local6:Vertex = null;
var local7:Vertex = null;
var local8:Vertex = null;
var local9:Number = NaN;
var local10:Number = NaN;
var local11:Number = NaN;
var local12:Number = NaN;
var local13:Number = NaN;
var local14:Number = NaN;
var local15:Number = NaN;
var local16:Number = NaN;
var local17:Number = NaN;
var local18:Number = NaN;
var local19:Number = NaN;
var local20:Number = NaN;
var local21:Number = NaN;
var local22:Number = NaN;
var local23:Number = NaN;
var local24:Number = NaN;
var local25:Number = NaN;
var local26:Number = NaN;
var local27:Number = NaN;
var local28:Boolean = false;
var local29:Wrapper = null;
var local30:Number = NaN;
var local31:Number = NaN;
var local32:Number = NaN;
var local33:Number = NaN;
var local34:Number = NaN;
var local35:Number = NaN;
var local36:Number = NaN;
var local37:Number = NaN;
var local38:Number = NaN;
var local39:Number = NaN;
var local40:Number = NaN;
var local41:Number = NaN;
var local42:Number = NaN;
var local43:Number = NaN;
var local44:Number = NaN;
var local45:Number = NaN;
var local46:Number = NaN;
var local1:Number = 1;
var local2:Number = this.displ.length;
var local3:int = 0;
while(local3 < this.facesLength) {
local4 = this.faces[local3];
local5 = local4.alternativa3d::wrapper;
local6 = local5.alternativa3d::vertex;
local5 = local5.alternativa3d::next;
local7 = local5.alternativa3d::vertex;
local5 = local5.alternativa3d::next;
local8 = local5.alternativa3d::vertex;
local9 = local7.alternativa3d::cameraX - local6.alternativa3d::cameraX;
local10 = local7.alternativa3d::cameraY - local6.alternativa3d::cameraY;
local11 = local7.alternativa3d::cameraZ - local6.alternativa3d::cameraZ;
local12 = local8.alternativa3d::cameraX - local6.alternativa3d::cameraX;
local13 = local8.alternativa3d::cameraY - local6.alternativa3d::cameraY;
local14 = local8.alternativa3d::cameraZ - local6.alternativa3d::cameraZ;
local15 = local14 * local10 - local13 * local11;
local16 = local12 * local11 - local14 * local9;
local17 = local13 * local9 - local12 * local10;
local18 = local15 * local15 + local16 * local16 + local17 * local17;
if(local18 > 0.001) {
local18 = 1 / Math.sqrt(local18);
local15 *= local18;
local16 *= local18;
local17 *= local18;
local19 = local6.alternativa3d::cameraX * local15 + local6.alternativa3d::cameraY * local16 + local6.alternativa3d::cameraZ * local17;
local20 = this.src.x * local15 + this.src.y * local16 + this.src.z * local17 - local19;
if(local20 < this.radius) {
local21 = this.src.x - local15 * local20;
local22 = this.src.y - local16 * local20;
local23 = this.src.z - local17 * local20;
} else {
local33 = (local20 - this.radius) / (local20 - this.dest.x * local15 - this.dest.y * local16 - this.dest.z * local17 + local19);
local21 = this.src.x + this.displ.x * local33 - local15 * this.radius;
local22 = this.src.y + this.displ.y * local33 - local16 * this.radius;
local23 = this.src.z + this.displ.z * local33 - local17 * this.radius;
}
local27 = 1e+22;
local28 = true;
local29 = local4.alternativa3d::wrapper;
while(local29 != null) {
local6 = local29.alternativa3d::vertex;
local7 = local29.alternativa3d::next != null ? local29.alternativa3d::next.alternativa3d::vertex : local4.alternativa3d::wrapper.alternativa3d::vertex;
local9 = local7.alternativa3d::cameraX - local6.alternativa3d::cameraX;
local10 = local7.alternativa3d::cameraY - local6.alternativa3d::cameraY;
local11 = local7.alternativa3d::cameraZ - local6.alternativa3d::cameraZ;
local12 = local21 - local6.alternativa3d::cameraX;
local13 = local22 - local6.alternativa3d::cameraY;
local14 = local23 - local6.alternativa3d::cameraZ;
local34 = local14 * local10 - local13 * local11;
local35 = local12 * local11 - local14 * local9;
local36 = local13 * local9 - local12 * local10;
if(local34 * local15 + local35 * local16 + local36 * local17 < 0) {
local37 = local9 * local9 + local10 * local10 + local11 * local11;
local38 = (local34 * local34 + local35 * local35 + local36 * local36) / local37;
if(local38 < local27) {
local37 = Math.sqrt(local37);
local9 /= local37;
local10 /= local37;
local11 /= local37;
local33 = local9 * local12 + local10 * local13 + local11 * local14;
if(local33 < 0) {
local39 = local12 * local12 + local13 * local13 + local14 * local14;
if(local39 < local27) {
local27 = local39;
local24 = Number(local6.alternativa3d::cameraX);
local25 = Number(local6.alternativa3d::cameraY);
local26 = Number(local6.alternativa3d::cameraZ);
}
} else if(local33 > local37) {
local12 = local21 - local7.alternativa3d::cameraX;
local13 = local22 - local7.alternativa3d::cameraY;
local14 = local23 - local7.alternativa3d::cameraZ;
local39 = local12 * local12 + local13 * local13 + local14 * local14;
if(local39 < local27) {
local27 = local39;
local24 = Number(local7.alternativa3d::cameraX);
local25 = Number(local7.alternativa3d::cameraY);
local26 = Number(local7.alternativa3d::cameraZ);
}
} else {
local27 = local38;
local24 = local6.alternativa3d::cameraX + local9 * local33;
local25 = local6.alternativa3d::cameraY + local10 * local33;
local26 = local6.alternativa3d::cameraZ + local11 * local33;
}
}
local28 = false;
}
local29 = local29.alternativa3d::next;
}
if(local28) {
local24 = local21;
local25 = local22;
local26 = local23;
}
local30 = this.src.x - local24;
local31 = this.src.y - local25;
local32 = this.src.z - local26;
if(local30 * this.displ.x + local31 * this.displ.y + local32 * this.displ.z <= 0) {
local40 = -this.displ.x / local2;
local41 = -this.displ.y / local2;
local42 = -this.displ.z / local2;
local43 = local30 * local30 + local31 * local31 + local32 * local32;
local44 = local30 * local40 + local31 * local41 + local32 * local42;
local45 = this.radius * this.radius - local43 + local44 * local44;
if(local45 > 0) {
local46 = (local44 - Math.sqrt(local45)) / local2;
if(local46 < local1) {
local1 = local46;
this.collisionPoint.x = local24;
this.collisionPoint.y = local25;
this.collisionPoint.z = local26;
if(local28) {
this.collisionPlane.x = local15;
this.collisionPlane.y = local16;
this.collisionPlane.z = local17;
this.collisionPlane.w = local19;
} else {
local43 = Math.sqrt(local43);
this.collisionPlane.x = local30 / local43;
this.collisionPlane.y = local31 / local43;
this.collisionPlane.z = local32 / local43;
this.collisionPlane.w = this.collisionPoint.x * this.collisionPlane.x + this.collisionPoint.y * this.collisionPlane.y + this.collisionPoint.z * this.collisionPlane.z;
}
}
}
}
}
local3++;
}
return local1 < 1;
}
}
}
|
package projects.tanks.client.battlefield.models.tankparts.weapons.common.charging {
public interface IWeaponChargingCommunicationModelBase {
function handleChargingFinish(param1:int) : void;
function handleChargingStart() : void;
}
}
|
package projects.tanks.client.entrance.model.entrance.changeuid {
public interface IChangeUidModelBase {
function parametersIncorrect() : void;
function passwordIncorrect() : void;
function startChangingUid() : void;
function startChangingUidViaPartner() : void;
function uidChanged() : void;
function uidIncorrect() : void;
}
}
|
package alternativa.tanks.controller.events {
import flash.display.Bitmap;
import flash.events.Event;
public class RegistrationBackgroundLoadedEvent extends Event {
public static const LOADED:String = "RegistrationBackgroundLoadedEvent.LOADED";
private var _backgroundImage:Bitmap;
public function RegistrationBackgroundLoadedEvent(param1:Bitmap) {
super(LOADED);
this._backgroundImage = param1;
}
public function get backgroundImage() : Bitmap {
return this._backgroundImage;
}
}
}
|
package projects.tanks.client.battlefield.models.tankparts.weapon.streamweapon {
public class StreamWeaponCC {
private var _energyCapacity:Number;
private var _energyDischargeSpeed:Number;
private var _energyRechargeSpeed:Number;
private var _weaponTickIntervalMsec:Number;
public function StreamWeaponCC(param1:Number = 0, param2:Number = 0, param3:Number = 0, param4:Number = 0) {
super();
this._energyCapacity = param1;
this._energyDischargeSpeed = param2;
this._energyRechargeSpeed = param3;
this._weaponTickIntervalMsec = param4;
}
public function get energyCapacity() : Number {
return this._energyCapacity;
}
public function set energyCapacity(param1:Number) : void {
this._energyCapacity = param1;
}
public function get energyDischargeSpeed() : Number {
return this._energyDischargeSpeed;
}
public function set energyDischargeSpeed(param1:Number) : void {
this._energyDischargeSpeed = param1;
}
public function get energyRechargeSpeed() : Number {
return this._energyRechargeSpeed;
}
public function set energyRechargeSpeed(param1:Number) : void {
this._energyRechargeSpeed = param1;
}
public function get weaponTickIntervalMsec() : Number {
return this._weaponTickIntervalMsec;
}
public function set weaponTickIntervalMsec(param1:Number) : void {
this._weaponTickIntervalMsec = param1;
}
public function toString() : String {
var local1:String = "StreamWeaponCC [";
local1 += "energyCapacity = " + this.energyCapacity + " ";
local1 += "energyDischargeSpeed = " + this.energyDischargeSpeed + " ";
local1 += "energyRechargeSpeed = " + this.energyRechargeSpeed + " ";
local1 += "weaponTickIntervalMsec = " + this.weaponTickIntervalMsec + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.models.battle.gui.inventory {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.models.battle.gui.inventory.HudInventoryIcon_mineGrayIconClass.png")]
public class HudInventoryIcon_mineGrayIconClass extends BitmapAsset {
public function HudInventoryIcon_mineGrayIconClass() {
super();
}
}
}
|
package alternativa.tanks.models.battle.ctf {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.models.battle.ctf.CTFHudIndicators_flagOutOfBaseBlue.png")]
public class CTFHudIndicators_flagOutOfBaseBlue extends BitmapAsset {
public function CTFHudIndicators_flagOutOfBaseBlue() {
super();
}
}
}
|
package alternativa.tanks.models.battle.battlefield {
import alternativa.tanks.utils.EncryptedInt;
import alternativa.tanks.utils.EncryptedIntImpl;
import flash.media.Sound;
public class BattleData {
public var respawnDurationMs:int;
public var battleFinishSound:Sound;
public var ambientSound:Sound;
public var tankExplosionSound:Sound;
private var idleKickPeriod:EncryptedInt = new EncryptedIntImpl();
public function BattleData() {
super();
}
public function setIdleKickPeriod(param1:int) : void {
this.idleKickPeriod.setInt(param1);
}
public function getIdleKickPeriod() : int {
return this.idleKickPeriod.getInt();
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.