mirror of
https://github.com/MapMakersAndProgrammers/TankiOnline2.0DemoClient.git
synced 2025-10-26 09:59:07 -07:00
package_7 alternativa.tanks
This commit is contained in:
19
src/alternativa/tanks/ITextureResourceService.as
Normal file
19
src/alternativa/tanks/ITextureResourceService.as
Normal file
@@ -0,0 +1,19 @@
|
||||
package alternativa.tanks
|
||||
{
|
||||
import flash.display.BitmapData;
|
||||
import flash.utils.ByteArray;
|
||||
import package_28.name_241;
|
||||
import package_28.name_93;
|
||||
|
||||
public interface ITextureResourceService
|
||||
{
|
||||
function getCompressedTextureResource(param1:ByteArray) : name_241;
|
||||
|
||||
function releaseCompressedTextureResource(param1:ByteArray) : void;
|
||||
|
||||
function getBitmapTextureResource(param1:BitmapData) : name_93;
|
||||
|
||||
function releaseBitmapTextureResource(param1:BitmapData) : void;
|
||||
}
|
||||
}
|
||||
|
||||
92
src/alternativa/tanks/InitBattleTask.as
Normal file
92
src/alternativa/tanks/InitBattleTask.as
Normal file
@@ -0,0 +1,92 @@
|
||||
package alternativa.tanks
|
||||
{
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import package_10.class_1;
|
||||
import package_10.name_17;
|
||||
import package_10.name_54;
|
||||
import package_13.name_18;
|
||||
import package_13.name_58;
|
||||
import package_13.name_70;
|
||||
import package_15.name_55;
|
||||
import package_18.name_44;
|
||||
import package_19.name_53;
|
||||
import package_2.A3DMapComponent;
|
||||
import package_9.name_20;
|
||||
|
||||
public class InitBattleTask extends class_1
|
||||
{
|
||||
private var gameKernel:name_17;
|
||||
|
||||
private var config:name_18;
|
||||
|
||||
private var container:DisplayObjectContainer;
|
||||
|
||||
private var preloader:Preloader;
|
||||
|
||||
public function InitBattleTask(param1:name_17, param2:name_18, param3:DisplayObjectContainer, param4:Preloader)
|
||||
{
|
||||
super(name_17.EVENT_SYSTEM_PRIORITY + 1);
|
||||
this.gameKernel = param1;
|
||||
this.config = param2;
|
||||
this.preloader = param4;
|
||||
this.container = param3;
|
||||
}
|
||||
|
||||
override public function run() : void
|
||||
{
|
||||
var _loc1_:name_44 = this.gameKernel.name_5();
|
||||
var _loc2_:name_20 = new name_20(_loc1_.name_27(),this.gameKernel.name_66());
|
||||
_loc1_.name_63(_loc2_);
|
||||
_loc2_.name_75(0,0,1000);
|
||||
_loc2_.name_76(0,2000,0);
|
||||
this.container.addChild(_loc1_.name_71());
|
||||
var _loc3_:name_54 = this.createMapEntity();
|
||||
this.gameKernel.name_73(_loc3_);
|
||||
this.preloader.name_69(0.75);
|
||||
var_4.addTask(new TankTestTask(name_17.INPUT_SYSTEM_PRIORITY + 1,this.config,this.gameKernel,_loc2_,this.preloader));
|
||||
var_4.killTask(this);
|
||||
}
|
||||
|
||||
private function createMapEntity() : name_54
|
||||
{
|
||||
var _loc2_:name_55 = null;
|
||||
var _loc6_:name_58 = null;
|
||||
var _loc7_:String = null;
|
||||
var _loc3_:name_70 = this.config.name_68.name_72("skybox");
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
_loc2_ = new name_55();
|
||||
_loc6_ = _loc3_.name_62(this.config.name_67());
|
||||
for each(_loc7_ in [name_53.BACK,name_53.BOTTOM,name_53.FRONT,name_53.LEFT,name_53.RIGHT,name_53.TOP])
|
||||
{
|
||||
_loc2_.name_59(_loc7_,_loc6_.name_65(_loc7_));
|
||||
}
|
||||
}
|
||||
var _loc4_:name_54 = new name_54(name_54.name_74());
|
||||
var _loc5_:A3DMapComponent = new A3DMapComponent(this.config.mapData,_loc2_,1000000,new MapListener(this.gameKernel.name_61()));
|
||||
_loc4_.name_60(_loc5_);
|
||||
_loc4_.name_64();
|
||||
return _loc4_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import package_10.name_57;
|
||||
import package_2.class_2;
|
||||
import package_20.name_56;
|
||||
|
||||
class MapListener implements class_2
|
||||
{
|
||||
private var eventSystem:name_56;
|
||||
|
||||
public function MapListener(param1:name_56)
|
||||
{
|
||||
super();
|
||||
this.eventSystem = param1;
|
||||
}
|
||||
|
||||
public function onA3DMapComplete() : void
|
||||
{
|
||||
this.eventSystem.dispatchEvent(name_57.MAP_COMPLETE,null);
|
||||
}
|
||||
}
|
||||
75
src/alternativa/tanks/TankParams.as
Normal file
75
src/alternativa/tanks/TankParams.as
Normal file
@@ -0,0 +1,75 @@
|
||||
package alternativa.tanks
|
||||
{
|
||||
import package_40.name_564;
|
||||
|
||||
public class TankParams
|
||||
{
|
||||
public static const defaultTankParams:TankParams = getDefaultTankParams();
|
||||
|
||||
public var x:Number = 0;
|
||||
|
||||
public var y:Number = 0;
|
||||
|
||||
public var z:Number = 0;
|
||||
|
||||
public var rotationX:Number = 0;
|
||||
|
||||
public var rotationY:Number = 0;
|
||||
|
||||
public var rotationZ:Number = 0;
|
||||
|
||||
public var hull:String = "";
|
||||
|
||||
public var turret:String = "";
|
||||
|
||||
public var coloring:int = 0;
|
||||
|
||||
public var isUser:Boolean = false;
|
||||
|
||||
public function TankParams()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
private static function getDefaultTankParams() : TankParams
|
||||
{
|
||||
var _loc1_:TankParams = new TankParams();
|
||||
_loc1_.y = 1000;
|
||||
_loc1_.z = 1000;
|
||||
_loc1_.isUser = true;
|
||||
_loc1_.hull = "Wasp M1";
|
||||
_loc1_.turret = "Smoky M1";
|
||||
return _loc1_;
|
||||
}
|
||||
|
||||
public static function name_317(param1:XML, param2:Boolean = false) : TankParams
|
||||
{
|
||||
var _loc3_:TankParams = new TankParams();
|
||||
_loc3_.isUser = param2;
|
||||
var _loc4_:Array = name_564.name_565(XMLList(param1.xyz)[0]);
|
||||
if(_loc4_.length == 3)
|
||||
{
|
||||
_loc3_.x = Number(_loc4_[0]);
|
||||
_loc3_.y = Number(_loc4_[1]);
|
||||
_loc3_.z = Number(_loc4_[2]);
|
||||
}
|
||||
_loc4_ = name_564.name_565(XMLList(param1.rotation)[0]);
|
||||
if(_loc4_.length == 3)
|
||||
{
|
||||
_loc3_.rotationX = Number(_loc4_[0]);
|
||||
_loc3_.rotationY = Number(_loc4_[1]);
|
||||
_loc3_.rotationZ = Number(_loc4_[2]);
|
||||
}
|
||||
_loc3_.hull = param1.hull;
|
||||
_loc3_.turret = param1.turret;
|
||||
_loc3_.coloring = int(param1.coloring);
|
||||
return _loc3_;
|
||||
}
|
||||
|
||||
public static function name_322(param1:Array) : TankParams
|
||||
{
|
||||
return new TankParams();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1431
src/alternativa/tanks/TankTestTask.as
Normal file
1431
src/alternativa/tanks/TankTestTask.as
Normal file
File diff suppressed because it is too large
Load Diff
142
src/alternativa/tanks/TextureResourceService.as
Normal file
142
src/alternativa/tanks/TextureResourceService.as
Normal file
@@ -0,0 +1,142 @@
|
||||
package alternativa.tanks
|
||||
{
|
||||
import flash.display.BitmapData;
|
||||
import flash.utils.ByteArray;
|
||||
import flash.utils.Dictionary;
|
||||
import package_10.name_17;
|
||||
import package_117.name_542;
|
||||
import package_28.name_241;
|
||||
import package_28.name_93;
|
||||
import package_79.name_326;
|
||||
|
||||
public class TextureResourceService implements ITextureResourceService
|
||||
{
|
||||
public var gameKernel:name_17;
|
||||
|
||||
private var var_455:name_326;
|
||||
|
||||
private var var_453:name_542;
|
||||
|
||||
private var var_454:name_326;
|
||||
|
||||
private var var_457:Dictionary;
|
||||
|
||||
private var var_456:Dictionary;
|
||||
|
||||
public function TextureResourceService(param1:name_17)
|
||||
{
|
||||
super();
|
||||
this.gameKernel = param1;
|
||||
this.var_457 = new Dictionary();
|
||||
this.var_456 = new Dictionary();
|
||||
}
|
||||
|
||||
public function name_254(param1:ByteArray) : name_241
|
||||
{
|
||||
var _loc2_:name_241 = this.getCompressedResourceSafe(param1,true);
|
||||
if(!_loc2_.isUploaded)
|
||||
{
|
||||
this.gameKernel.name_5().method_29(_loc2_);
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
public function method_435(param1:ByteArray) : void
|
||||
{
|
||||
var _loc2_:name_241 = this.getCompressedResourceSafe(param1,false);
|
||||
if(_loc2_ != null)
|
||||
{
|
||||
this.gameKernel.name_5().method_28(_loc2_);
|
||||
}
|
||||
}
|
||||
|
||||
public function name_320(param1:BitmapData) : name_93
|
||||
{
|
||||
var _loc2_:name_93 = this.getBitmapResourceSafe(param1,true);
|
||||
this.gameKernel.name_5().method_29(_loc2_);
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
public function method_434(param1:BitmapData) : void
|
||||
{
|
||||
var _loc2_:name_93 = this.getBitmapResourceSafe(param1,false);
|
||||
if(_loc2_ != null)
|
||||
{
|
||||
this.gameKernel.name_5().method_28(_loc2_);
|
||||
}
|
||||
}
|
||||
|
||||
private function getCompressedResourceSafe(param1:ByteArray, param2:Boolean) : name_241
|
||||
{
|
||||
var _loc3_:name_241 = this.var_457[param1];
|
||||
if(_loc3_ == null && param2)
|
||||
{
|
||||
_loc3_ = new name_241(param1);
|
||||
this.var_457[param1] = _loc3_;
|
||||
}
|
||||
return _loc3_;
|
||||
}
|
||||
|
||||
private function getBitmapResourceSafe(param1:BitmapData, param2:Boolean) : name_93
|
||||
{
|
||||
var _loc3_:name_93 = this.var_456[param1];
|
||||
if(_loc3_ == null && param2)
|
||||
{
|
||||
_loc3_ = new name_93(param1);
|
||||
this.var_456[param1] = _loc3_;
|
||||
}
|
||||
return _loc3_;
|
||||
}
|
||||
|
||||
public function clear() : void
|
||||
{
|
||||
this.gameKernel = null;
|
||||
this.var_455 = null;
|
||||
this.var_453 = null;
|
||||
this.var_454 = null;
|
||||
}
|
||||
|
||||
public function method_440() : name_326
|
||||
{
|
||||
if(this.var_455 == null)
|
||||
{
|
||||
throw new Error("Generic target evaluator is not set");
|
||||
}
|
||||
return this.var_455;
|
||||
}
|
||||
|
||||
public function method_439(param1:name_326) : void
|
||||
{
|
||||
this.var_455 = param1;
|
||||
}
|
||||
|
||||
public function method_443() : name_542
|
||||
{
|
||||
if(this.var_453 == null)
|
||||
{
|
||||
throw new Error("Railgun target evaluator is not set");
|
||||
}
|
||||
return this.var_453;
|
||||
}
|
||||
|
||||
public function method_438(param1:name_542) : void
|
||||
{
|
||||
this.var_453 = param1;
|
||||
}
|
||||
|
||||
public function method_441() : name_326
|
||||
{
|
||||
if(this.var_454 == null)
|
||||
{
|
||||
throw new Error("Flame/freeze target evaluator is not set");
|
||||
}
|
||||
return this.var_454;
|
||||
}
|
||||
|
||||
public function method_442(param1:name_326) : void
|
||||
{
|
||||
this.var_454 = param1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user