Compare commits
4 Commits
c34308ed7c
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| ee4438f2b4 | |||
| 4212d85d86 | |||
| 0b24c03068 | |||
| b24c71678e |
@@ -8,5 +8,6 @@ indent_size = 2
|
|||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
[*.yaml]
|
[*.md]
|
||||||
indent_size = 2
|
max_line_length = off
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|||||||
@@ -19,3 +19,6 @@ DOCKER_PROJECTS=(
|
|||||||
DOCKER_ARGS=(
|
DOCKER_ARGS=(
|
||||||
"PROJECT_NAME=$PROJECT"
|
"PROJECT_NAME=$PROJECT"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
NEKO_SDK="$SDK_PATH/neko/2.2.0"
|
||||||
|
HAXE_SDK="$SDK_PATH/haxe/4.2.5"
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
[defaults]
|
|
||||||
hash_behaviour = merge
|
|
||||||
host_key_checking = False
|
|
||||||
#callback_whitelist = profile_tasks
|
|
||||||
display_skipped_hosts = False
|
|
||||||
stdout_callback = yaml
|
|
||||||
bin_ansible_callbacks = True
|
|
||||||
|
|
||||||
[ssh_connection]
|
|
||||||
pipelining = True
|
|
||||||
ssh_args = -o ForwardAgent=yes
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: all
|
|
||||||
vars:
|
|
||||||
ansible_user: "{{ deploy_user }}"
|
|
||||||
roles:
|
|
||||||
- ansible-deploy
|
|
||||||
- build
|
|
||||||
post_tasks:
|
|
||||||
- include_role:
|
|
||||||
name: ansible-deploy
|
|
||||||
tasks_from: complete.yml
|
|
||||||
- include_role:
|
|
||||||
name: service
|
|
||||||
tasks_from: restart.yml
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
all:
|
|
||||||
hosts: localhost
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
project_name: tankz
|
|
||||||
project_user: holop
|
|
||||||
|
|
||||||
deploy_user: "{{ project_user }}"
|
|
||||||
deploy_project: "{{ project_name }}"
|
|
||||||
deploy_repo_url: "git@bitbucket.org:infernalgames/{{ project_name }}.git"
|
|
||||||
deploy_repo_version: develop
|
|
||||||
deploy_npm: yes
|
|
||||||
|
|
||||||
service_name: "{{ project_name }}"
|
|
||||||
service_work_dir: "{{ deploy_current_dir }}/target/server/cpp"
|
|
||||||
service_command: "{{ service_work_dir }}/{{ project_name }} {{ service_host }}"
|
|
||||||
service_user: www-data
|
|
||||||
service_control_user: "{{ project_user }}"
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
all:
|
|
||||||
hosts: shmyga.ru
|
|
||||||
vars:
|
|
||||||
service_host: 213.139.208.180
|
|
||||||
config_src: "/home/holop/tankz/config.json"
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
- name: ansible-deploy
|
|
||||||
src: git@bitbucket.org:shmyga/ansible-deploy.git
|
|
||||||
version: master
|
|
||||||
scm: git
|
|
||||||
|
|
||||||
- name: geerlingguy.nodejs
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
config_src: "{{ deploy_release_dir }}/config.{{ inventory_hostname }}.json"
|
|
||||||
config_dest: "{{ deploy_release_dir }}/config.json"
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
- name: "Copy config"
|
|
||||||
copy:
|
|
||||||
src: "{{ config_src }}"
|
|
||||||
dest: "{{ config_dest }}"
|
|
||||||
remote_src: true
|
|
||||||
|
|
||||||
- name: "Gulp build"
|
|
||||||
command: "{{ deploy_release_dir }}/node_modules/.bin/gulp default --host shmyga.ru"
|
|
||||||
args:
|
|
||||||
chdir: "{{ deploy_release_dir }}"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
service_name: null
|
|
||||||
service_description: "{{ service_name }} service"
|
|
||||||
service_work_dir: null
|
|
||||||
service_command: null
|
|
||||||
service_user: null
|
|
||||||
service_control_user: null
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
---
|
|
||||||
- name: "Install {{ service_name }} systemd unit file"
|
|
||||||
template:
|
|
||||||
src: "template/service.j2"
|
|
||||||
dest: "/etc/systemd/system/{{ service_name }}.service"
|
|
||||||
|
|
||||||
- name: "Start {{ service_name }} service"
|
|
||||||
systemd:
|
|
||||||
enabled: yes
|
|
||||||
state: started
|
|
||||||
name: "{{ service_name }}"
|
|
||||||
daemon_reload: yes
|
|
||||||
|
|
||||||
- name: "Add sudoers record for {{ service_name }} service"
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/sudoers.d/{{ service_name }}
|
|
||||||
state: present
|
|
||||||
create: yes
|
|
||||||
regexp: "^{{ service_control_user }} ALL="
|
|
||||||
line: "{{ service_control_user }} ALL= NOPASSWD: /bin/systemctl * {{ service_name }}"
|
|
||||||
validate: "/usr/sbin/visudo -cf %s"
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
# - name: "Restart {{ service_name }} service"
|
|
||||||
# systemd:
|
|
||||||
# enabled: yes
|
|
||||||
# state: restarted
|
|
||||||
# name: "{{ service_name }}"
|
|
||||||
|
|
||||||
- name: "Restart {{ service_name }} service"
|
|
||||||
command: "sudo /bin/systemctl restart {{ service_name }}"
|
|
||||||
args:
|
|
||||||
warn: no
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description={{ service_description }}
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
PIDFile=/var/run/{{ service_name }}.pid
|
|
||||||
WorkingDirectory={{ service_work_dir }}
|
|
||||||
User={{ service_user }}
|
|
||||||
Group={{ service_user }}
|
|
||||||
ExecStart={{ service_command }}
|
|
||||||
TimeoutSec=300
|
|
||||||
Restart=always
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
- name: "Install neko package"
|
|
||||||
apt:
|
|
||||||
name: neko
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
- import_tasks: apt.yml
|
|
||||||
when: ansible_distribution|lower == 'ubuntu'
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCot1zSeqj7Tj5/7aNMzXAuXQPPxudYFV9z6M03dPijh2bXyHDcXk53xUO8XY5R4GyLhvAn98axbPM++urKY8BXuQqAG36soI7iZJ/KcPY1EKDwVBeZneFC/wMc8HMT0hj9+uHcGAMtmklIgPPkawzLxbEh6oAY4H8Vvz08qyco6suYB5NjkpFwVMf9Xa2Fj8rTodKpPRDBh/Xk+5bh11RKL6b9WcwuwpKU8zl2qZiqNfjr0H+sKEk7ohcYvzSCltLdKJcoKbiCcnrnBJT5/JpGWeAbA2MMmvmt/dJrHykd1CbmXW2DuG4tIlwMb5xU739PoKCePctK1retb8TrWOLT shmyga@shmyga-desktop
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
# barin
|
|
||||||
- name: Make barin group
|
|
||||||
group:
|
|
||||||
name: barin
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Make barin user
|
|
||||||
user:
|
|
||||||
name: barin
|
|
||||||
group: barin
|
|
||||||
password: '$6$mbw5KZWwtrRUy$eFcMNTW.QzG1Em45r5hZf/qri4hKAHImozWuW4/pYnDK.tOrVKrXTKYfRDtYEFRgCgVVg0zuPvyq/xn0KiKlz0'
|
|
||||||
groups: www-data,sudo,adm
|
|
||||||
|
|
||||||
- name: Set up authorized_keys for the barin user
|
|
||||||
authorized_key:
|
|
||||||
user: barin
|
|
||||||
key: '{{ item }}'
|
|
||||||
with_file:
|
|
||||||
- keys/shmyga.pub
|
|
||||||
|
|
||||||
|
|
||||||
# holop
|
|
||||||
- name: Make holop group
|
|
||||||
group:
|
|
||||||
name: holop
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Make holop user
|
|
||||||
user:
|
|
||||||
name: holop
|
|
||||||
group: holop
|
|
||||||
password: '$6$B/7g0xlcXFCIHk$hzSjb8KLll7YrTsp3z640sxNixNAkLpm6UUdZgWPh0Ffy7Ue18AiXTzkDdGTaTH6Woz4kvgVDSggnKGTU6u03.'
|
|
||||||
groups: www-data
|
|
||||||
|
|
||||||
- name: Set up authorized_keys for the holop user
|
|
||||||
authorized_key:
|
|
||||||
user: holop
|
|
||||||
key: '{{ item }}'
|
|
||||||
with_file:
|
|
||||||
- keys/shmyga.pub
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ansible_become: yes
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: all
|
|
||||||
vars:
|
|
||||||
ansible_user: "{{ deploy_user }}"
|
|
||||||
tasks:
|
|
||||||
- include_role:
|
|
||||||
name: service
|
|
||||||
tasks_from: restart.yml
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts:
|
|
||||||
- all
|
|
||||||
pre_tasks:
|
|
||||||
- include_role:
|
|
||||||
name: ansible-deploy
|
|
||||||
tasks_from: facts.yml
|
|
||||||
roles:
|
|
||||||
- geerlingguy.nodejs
|
|
||||||
- setup
|
|
||||||
- service
|
|
||||||
vars:
|
|
||||||
nodejs_version: 9.x
|
|
||||||
nodejs_npm_global_packages: [gulp-cli]
|
|
||||||
vars_files:
|
|
||||||
- vars/barin.yml
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
- hosts: all
|
|
||||||
gather_facts: no
|
|
||||||
roles:
|
|
||||||
- user
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
---
|
|
||||||
ansible_user: barin
|
|
||||||
ansible_become_pass: 1234!QAZ
|
|
||||||
ansible_become: yes
|
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"indentation": {
|
"indentation": {
|
||||||
"character": " "
|
"character": " "
|
||||||
|
},
|
||||||
|
"wrapping": {
|
||||||
|
"maxLineLength": 120
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"yargs": "^13.2.4"
|
"yargs": "^13.2.4"
|
||||||
},
|
},
|
||||||
"haxeDependencies": {
|
"haxeDependencies": {
|
||||||
"haxework": "2.1.0",
|
"haxework": "2.1.1",
|
||||||
"lime": "8.0.0",
|
"lime": "8.0.0",
|
||||||
"openfl": "9.2.0",
|
"openfl": "9.2.0",
|
||||||
"hxcpp": "4.2.1",
|
"hxcpp": "4.2.1",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
cd "$(dirname $(dirname "$0"))" || exit
|
cd "$(dirname $(dirname "$0"))" || exit
|
||||||
|
|
||||||
|
source .env
|
||||||
source $NEKO_SDK/activate
|
source $NEKO_SDK/activate
|
||||||
source $HAXE_SDK/activate
|
source $HAXE_SDK/activate
|
||||||
haxelib install formatter
|
haxelib install formatter
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
cd "$(dirname $(dirname "$0"))" || exit
|
cd "$(dirname $(dirname "$0"))" || exit
|
||||||
|
|
||||||
|
source .env
|
||||||
source $NEKO_SDK/activate
|
source $NEKO_SDK/activate
|
||||||
source $HAXE_SDK/activate
|
source $HAXE_SDK/activate
|
||||||
haxelib install formatter
|
haxelib install formatter
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ package ru.m;
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Device {
|
class Device {
|
||||||
|
|
||||||
public static var platform(get, null):Platform;
|
public static var platform(get, null):Platform;
|
||||||
|
|
||||||
private static function get_platform():Platform {
|
private static function get_platform():Platform {
|
||||||
@@ -22,9 +21,8 @@ class Device {
|
|||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
private static var MOBILES(default, never):Array<String> = [
|
private static var MOBILES(default,
|
||||||
"Android", "webOS", "iPhone", "iPad", "iPod", "BlackBerry", "Windows Phone",
|
never):Array<String> = ["Android", "webOS", "iPhone", "iPad", "iPod", "BlackBerry", "Windows Phone",];
|
||||||
];
|
|
||||||
|
|
||||||
public static function isMobile():Bool {
|
public static function isMobile():Bool {
|
||||||
#if android
|
#if android
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ typedef Frame = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Animate extends Bitmap {
|
class Animate extends Bitmap {
|
||||||
|
|
||||||
public var playing(default, default):Bool;
|
public var playing(default, default):Bool;
|
||||||
public var frames(default, set):Array<Frame>;
|
public var frames(default, set):Array<Frame>;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import promhx.Deferred;
|
|||||||
import promhx.Promise;
|
import promhx.Promise;
|
||||||
|
|
||||||
class OnceAnimate extends Animate {
|
class OnceAnimate extends Animate {
|
||||||
|
|
||||||
private var deferred:Deferred<Animate>;
|
private var deferred:Deferred<Animate>;
|
||||||
|
|
||||||
public function play():Promise<Animate> {
|
public function play():Promise<Animate> {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import hw.signal.Signal;
|
|||||||
import ru.m.control.IControlBus;
|
import ru.m.control.IControlBus;
|
||||||
|
|
||||||
class ControlBus implements IControlBus {
|
class ControlBus implements IControlBus {
|
||||||
|
|
||||||
private static inline var TAG = "control";
|
private static inline var TAG = "control";
|
||||||
|
|
||||||
public var devices(default, null):Array<IControlDevice>;
|
public var devices(default, null):Array<IControlDevice>;
|
||||||
@@ -23,7 +22,7 @@ class ControlBus implements IControlBus {
|
|||||||
|
|
||||||
public function connect(device:IControlDevice):Void {
|
public function connect(device:IControlDevice):Void {
|
||||||
var connector = function(action:DeviceAction, on:Bool):Void {
|
var connector = function(action:DeviceAction, on:Bool):Void {
|
||||||
//L.d("TAG", '${device.type}, ${action}, ${on}');
|
// L.d("TAG", '${device.type}, ${action}, ${on}');
|
||||||
signal.emit(device.type, action, on);
|
signal.emit(device.type, action, on);
|
||||||
}
|
}
|
||||||
connections.set(device.type, connector);
|
connections.set(device.type, connector);
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import ru.m.control.DeviceType;
|
|||||||
import ru.m.geom.Direction;
|
import ru.m.geom.Direction;
|
||||||
|
|
||||||
class JoystickDevice implements IControlDevice {
|
class JoystickDevice implements IControlDevice {
|
||||||
|
|
||||||
public var type(default, null):DeviceType;
|
public var type(default, null):DeviceType;
|
||||||
public var signal(default, null):Signal2<DeviceAction, Bool>;
|
public var signal(default, null):Signal2<DeviceAction, Bool>;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import hw.signal.Signal;
|
|||||||
import ru.m.control.DeviceAction;
|
import ru.m.control.DeviceAction;
|
||||||
|
|
||||||
class KeyboardDevice implements IControlDevice {
|
class KeyboardDevice implements IControlDevice {
|
||||||
|
|
||||||
public var type(default, null):DeviceType;
|
public var type(default, null):DeviceType;
|
||||||
public var signal(default, null):Signal2<DeviceAction, Bool>;
|
public var signal(default, null):Signal2<DeviceAction, Bool>;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import flash.display.DisplayObject;
|
|||||||
import flash.display.DisplayObjectContainer;
|
import flash.display.DisplayObjectContainer;
|
||||||
|
|
||||||
class DisplayObjectContainerExtender {
|
class DisplayObjectContainerExtender {
|
||||||
|
|
||||||
public static function childrenIterator():Iterator<DisplayObject> {
|
public static function childrenIterator():Iterator<DisplayObject> {
|
||||||
throw "Not implemented";
|
throw "Not implemented";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ using StringTools;
|
|||||||
using hw.color.ColorUtil;
|
using hw.color.ColorUtil;
|
||||||
|
|
||||||
@:style class ButtonSVGSkin implements ISkin<ButtonView> {
|
@:style class ButtonSVGSkin implements ISkin<ButtonView> {
|
||||||
|
|
||||||
@:style(null) private var svg:String;
|
@:style(null) private var svg:String;
|
||||||
@:style(0) private var color:Null<Color>;
|
@:style(0) private var color:Null<Color>;
|
||||||
@:style(false) private var solid:Null<Bool>;
|
@:style(false) private var solid:Null<Bool>;
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import ru.m.skin.ButtonSVGSkin;
|
|||||||
using hw.color.ColorUtil;
|
using hw.color.ColorUtil;
|
||||||
|
|
||||||
class AppTheme extends Theme {
|
class AppTheme extends Theme {
|
||||||
|
|
||||||
public static var COLORS(default, never):ThemeColors = {
|
public static var COLORS(default, never):ThemeColors = {
|
||||||
light: 0x95937D,
|
light: 0x95937D,
|
||||||
dark: 0x777564,
|
dark: 0x777564,
|
||||||
@@ -29,17 +28,11 @@ class AppTheme extends Theme {
|
|||||||
|
|
||||||
override private function reload():Void {
|
override private function reload():Void {
|
||||||
super.reload();
|
super.reload();
|
||||||
register(new Style("light", [
|
register(new Style("light", ["skin.background.color" => colors.light,]));
|
||||||
"skin.background.color" => colors.light,
|
|
||||||
]));
|
|
||||||
|
|
||||||
register(new Style("dark", [
|
register(new Style("dark", ["skin.background.color" => colors.dark,]));
|
||||||
"skin.background.color" => colors.dark,
|
|
||||||
]));
|
|
||||||
|
|
||||||
register(new Style("font", [
|
register(new Style("font", ["_" => null,], ["text"]));
|
||||||
"_" => null,
|
|
||||||
], ["text"]));
|
|
||||||
|
|
||||||
register(new Style("text.header", [
|
register(new Style("text.header", [
|
||||||
"font.size" => fontSize.big,
|
"font.size" => fontSize.big,
|
||||||
@@ -97,14 +90,10 @@ class AppTheme extends Theme {
|
|||||||
"layout.vAlign" => VAlign.MIDDLE,
|
"layout.vAlign" => VAlign.MIDDLE,
|
||||||
], ["light"]));
|
], ["light"]));
|
||||||
|
|
||||||
register(new Style("panel_button", [
|
register(new Style("panel_button",
|
||||||
"font.size" => fontSize.big,
|
["font.size" => fontSize.big, "geometry.height" => SizeValue.fromString("100%"),], ["button"]));
|
||||||
"geometry.height" => SizeValue.fromString("100%"),
|
|
||||||
], ["button"]));
|
|
||||||
|
|
||||||
register(new Style("window", [
|
register(new Style("window", ["geometry.padding" => Box.fromFloat(2),], ["dark", "border"]));
|
||||||
"geometry.padding" => Box.fromFloat(2),
|
|
||||||
], ["dark", "border"]));
|
|
||||||
|
|
||||||
register(new Style("line", [
|
register(new Style("line", [
|
||||||
"geometry.width" => SizeValue.fromString("100%"),
|
"geometry.width" => SizeValue.fromString("100%"),
|
||||||
@@ -112,7 +101,8 @@ class AppTheme extends Theme {
|
|||||||
], ["border"]));
|
], ["border"]));
|
||||||
|
|
||||||
register(new Style("window.close", [
|
register(new Style("window.close", [
|
||||||
"skin" => function() return new ButtonSVGSkin(Assets.getText("resources/image/icon/window-close-solid.svg"), colors.light),
|
"skin" => function() return new ButtonSVGSkin(Assets.getText("resources/image/icon/window-close-solid.svg"),
|
||||||
|
colors.light),
|
||||||
"geometry.width" => SizeValue.fromString("8h"),
|
"geometry.width" => SizeValue.fromString("8h"),
|
||||||
"geometry.height" => SizeValue.fromString("8h"),
|
"geometry.height" => SizeValue.fromString("8h"),
|
||||||
]));
|
]));
|
||||||
@@ -137,14 +127,8 @@ class AppTheme extends Theme {
|
|||||||
"skin.border.thickness" => 5,
|
"skin.border.thickness" => 5,
|
||||||
"skin.round" => 10,
|
"skin.round" => 10,
|
||||||
], ["light"]));
|
], ["light"]));
|
||||||
register(new Style("player.winner", [
|
register(new Style("player.winner", ["skin.background.alpha" => 0.2, "skin.background.color" => green,]));
|
||||||
"skin.background.alpha" => 0.2,
|
register(new Style("player.loser", ["skin.background.alpha" => 0.2, "skin.background.color" => red,]));
|
||||||
"skin.background.color" => green,
|
|
||||||
]));
|
|
||||||
register(new Style("player.loser", [
|
|
||||||
"skin.background.alpha" => 0.2,
|
|
||||||
"skin.background.color" => red,
|
|
||||||
]));
|
|
||||||
|
|
||||||
register(new Style("button.pack", [
|
register(new Style("button.pack", [
|
||||||
"geometry.width" => SizeValue.fromString("35h"),
|
"geometry.width" => SizeValue.fromString("35h"),
|
||||||
@@ -157,9 +141,7 @@ class AppTheme extends Theme {
|
|||||||
"skin.round" => 15,
|
"skin.round" => 15,
|
||||||
], ["border", "light"]));
|
], ["border", "light"]));
|
||||||
|
|
||||||
register(new Style("button.menu", [
|
register(new Style("button.menu", ["geometry.padding" => Box.fromArray([20, 10]),]));
|
||||||
"geometry.padding" => Box.fromArray([20, 10]),
|
|
||||||
]));
|
|
||||||
|
|
||||||
registerButton("settings", "cog-solid.svg");
|
registerButton("settings", "cog-solid.svg");
|
||||||
registerButton("close", "times-circle-solid.svg");
|
registerButton("close", "times-circle-solid.svg");
|
||||||
@@ -174,27 +156,23 @@ class AppTheme extends Theme {
|
|||||||
registerButton("backspace", "backspace-light.svg", true);
|
registerButton("backspace", "backspace-light.svg", true);
|
||||||
registerButton("tablet-android-alt", "tablet-android-alt-light.svg", true);
|
registerButton("tablet-android-alt", "tablet-android-alt-light.svg", true);
|
||||||
|
|
||||||
register(new Style("gamepad", [
|
register(new Style("gamepad", ["skin.color" => colors.text, "skin.activeColor" => colors.active,]));
|
||||||
"skin.color" => colors.text,
|
|
||||||
"skin.activeColor" => colors.active,
|
|
||||||
]));
|
|
||||||
|
|
||||||
register(new Style("render", [
|
register(new Style("render", ["skin.background.color" => colors.dark,]));
|
||||||
"skin.background.color" => colors.dark,
|
|
||||||
]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function registerButton(name:String, resource:String, solid:Bool = false):Void {
|
private function registerButton(name:String, resource:String, solid:Bool = false):Void {
|
||||||
register(new Style('button.$name', [
|
register(new Style('button.$name', [
|
||||||
"geometry.width" => SizeValue.fromString("10h"),
|
"geometry.width" => SizeValue.fromString("10h"),
|
||||||
"geometry.height" => SizeValue.fromString("10h"),
|
"geometry.height" => SizeValue.fromString("10h"),
|
||||||
"skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light, solid),
|
"skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light,
|
||||||
|
solid),
|
||||||
]));
|
]));
|
||||||
register(new Style('button.$name.small', [
|
register(new Style('button.$name.small', [
|
||||||
"geometry.width" => SizeValue.fromString("7h"),
|
"geometry.width" => SizeValue.fromString("7h"),
|
||||||
"geometry.height" => SizeValue.fromString("7h"),
|
"geometry.height" => SizeValue.fromString("7h"),
|
||||||
"skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light, solid),
|
"skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light,
|
||||||
|
solid),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class Client {
|
|||||||
L.push(new hw.log.JSLogger());
|
L.push(new hw.log.JSLogger());
|
||||||
#end
|
#end
|
||||||
#if debug
|
#if debug
|
||||||
//L.push(new hw.log.SocketLogger());
|
// L.push(new hw.log.SocketLogger());
|
||||||
#end
|
#end
|
||||||
// ToDo: fix @:provide macro
|
// ToDo: fix @:provide macro
|
||||||
PopupManager;
|
PopupManager;
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import ru.m.tankz.proto.pack.Response;
|
|||||||
import ru.m.update.Updater;
|
import ru.m.update.Updater;
|
||||||
|
|
||||||
class Init {
|
class Init {
|
||||||
|
|
||||||
@:provide static var theme:ITheme;
|
@:provide static var theme:ITheme;
|
||||||
@:provide static var levelBundle:ILevelBundle;
|
@:provide static var levelBundle:ILevelBundle;
|
||||||
@:provide static var configBundle:IConfigBundle;
|
@:provide static var configBundle:IConfigBundle;
|
||||||
@@ -39,7 +38,8 @@ class Init {
|
|||||||
#if flash
|
#if flash
|
||||||
return new ru.m.connect.flash.FlashConnection<Request, Response>(host, port, Response);
|
return new ru.m.connect.flash.FlashConnection<Request, Response>(host, port, Response);
|
||||||
#elseif html5
|
#elseif html5
|
||||||
return new ru.m.connect.js.JsConnection<Request, Response>(host, port + (ru.m.connect.js.JsConnection.isSecured() ? 1 : 0), Response);
|
return new ru.m.connect.js.JsConnection<Request, Response>(host,
|
||||||
|
port + (ru.m.connect.js.JsConnection.isSecured() ? 1 : 0), Response);
|
||||||
#else
|
#else
|
||||||
return new ru.m.connect.desktop.DesktopConnection<Request, Response>(host, port, Response);
|
return new ru.m.connect.desktop.DesktopConnection<Request, Response>(host, port, Response);
|
||||||
#end
|
#end
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import flash.Lib;
|
|||||||
import openfl.Assets;
|
import openfl.Assets;
|
||||||
|
|
||||||
class LinuxIcon {
|
class LinuxIcon {
|
||||||
|
|
||||||
private static function prepareIcon(bitmap:BitmapData):BitmapData {
|
private static function prepareIcon(bitmap:BitmapData):BitmapData {
|
||||||
var matrix:Array<Float> = [];
|
var matrix:Array<Float> = [];
|
||||||
matrix = matrix.concat([0, 0, 1, 0, 0]);
|
matrix = matrix.concat([0, 0, 1, 0, 0]);
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import hw.view.geometry.Size;
|
|||||||
import ru.m.tankz.AppTheme;
|
import ru.m.tankz.AppTheme;
|
||||||
|
|
||||||
class Progress extends Sprite {
|
class Progress extends Sprite {
|
||||||
|
|
||||||
public var color(default, set):Int = 0;
|
public var color(default, set):Int = 0;
|
||||||
public var backColor(default, set):Int = 0;
|
public var backColor(default, set):Int = 0;
|
||||||
public var progress(default, set):Float = 0;
|
public var progress(default, set):Float = 0;
|
||||||
@@ -85,7 +84,7 @@ class Progress extends Sprite {
|
|||||||
maskShape.graphics.moveTo(radius, radius);
|
maskShape.graphics.moveTo(radius, radius);
|
||||||
var sides = 6;
|
var sides = 6;
|
||||||
var rotation = (-(Math.PI) / 2);
|
var rotation = (-(Math.PI) / 2);
|
||||||
var r = radius / Math.cos(1/sides * Math.PI);
|
var r = radius / Math.cos(1 / sides * Math.PI);
|
||||||
var lineToRadians = function(rads:Float):Void {
|
var lineToRadians = function(rads:Float):Void {
|
||||||
maskShape.graphics.lineTo(Math.cos(rads) * r + radius, Math.sin(rads) * r + radius);
|
maskShape.graphics.lineTo(Math.cos(rads) * r + radius, Math.sin(rads) * r + radius);
|
||||||
};
|
};
|
||||||
@@ -101,7 +100,6 @@ class Progress extends Sprite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Preloader extends Sprite {
|
class Preloader extends Sprite {
|
||||||
|
|
||||||
private var progress:Progress;
|
private var progress:Progress;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import ru.m.tankz.Type;
|
|||||||
import ru.m.tankz.util.LevelUtil;
|
import ru.m.tankz.util.LevelUtil;
|
||||||
|
|
||||||
class ClientLevelSource implements ILevelSource {
|
class ClientLevelSource implements ILevelSource {
|
||||||
|
|
||||||
public function new() {}
|
public function new() {}
|
||||||
|
|
||||||
public function resolveMeta(id:PackId):LevelPackMeta {
|
public function resolveMeta(id:PackId):LevelPackMeta {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import yaml.Parser;
|
|||||||
import yaml.Yaml;
|
import yaml.Yaml;
|
||||||
|
|
||||||
class ConfigBundle implements IConfigBundle {
|
class ConfigBundle implements IConfigBundle {
|
||||||
|
|
||||||
private var _cache:Map<GameType, Config> = new Map();
|
private var _cache:Map<GameType, Config> = new Map();
|
||||||
|
|
||||||
public function new() {}
|
public function new() {}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import ru.m.tankz.Type;
|
|||||||
using haxe.EnumTools.EnumValueTools;
|
using haxe.EnumTools.EnumValueTools;
|
||||||
|
|
||||||
class HumanControl extends Control {
|
class HumanControl extends Control {
|
||||||
|
|
||||||
@:provide static var storage:SettingsStorage;
|
@:provide static var storage:SettingsStorage;
|
||||||
@:provide static var bus:IControlBus;
|
@:provide static var bus:IControlBus;
|
||||||
|
|
||||||
@@ -110,7 +109,7 @@ class HumanControl extends Control {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function shooter(weapon:Int):Void -> Void {
|
private function shooter(weapon:Int):Void->Void {
|
||||||
return function():Void {
|
return function():Void {
|
||||||
action(SHOT(weapon));
|
action(SHOT(weapon));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import ru.m.tankz.control.HumanControl;
|
|||||||
import ru.m.tankz.Type;
|
import ru.m.tankz.Type;
|
||||||
|
|
||||||
class LocalControlFactory extends BaseControlFactory {
|
class LocalControlFactory extends BaseControlFactory {
|
||||||
|
|
||||||
override private function buildHuman(id:PlayerId, index:Int):Control {
|
override private function buildHuman(id:PlayerId, index:Int):Control {
|
||||||
return new HumanControl(id, index);
|
return new HumanControl(id, index);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import ru.m.tankz.storage.GameStorage;
|
|||||||
import ru.m.tankz.Type;
|
import ru.m.tankz.Type;
|
||||||
|
|
||||||
class LocalGame extends GameRunner {
|
class LocalGame extends GameRunner {
|
||||||
|
|
||||||
@:provide static var gameStorage:GameStorage;
|
@:provide static var gameStorage:GameStorage;
|
||||||
|
|
||||||
public function new(start:Start) {
|
public function new(start:Start) {
|
||||||
|
|||||||
@@ -5,10 +5,9 @@ import flash.events.Event;
|
|||||||
import ru.m.tankz.engine.ICaller;
|
import ru.m.tankz.engine.ICaller;
|
||||||
|
|
||||||
class StageCaller implements ICaller {
|
class StageCaller implements ICaller {
|
||||||
|
|
||||||
private var stage:Stage;
|
private var stage:Stage;
|
||||||
private var event:String;
|
private var event:String;
|
||||||
private var calback:Void -> Void;
|
private var calback:Void->Void;
|
||||||
|
|
||||||
public function new(stage:Stage, ?event:String) {
|
public function new(stage:Stage, ?event:String) {
|
||||||
this.stage = stage;
|
this.stage = stage;
|
||||||
@@ -19,7 +18,7 @@ class StageCaller implements ICaller {
|
|||||||
calback();
|
calback();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function start(calback:Void -> Void):Void {
|
public function start(calback:Void->Void):Void {
|
||||||
this.calback = calback;
|
this.calback = calback;
|
||||||
stage.addEventListener(event, onEvent);
|
stage.addEventListener(event, onEvent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import ru.m.tankz.network.NetworkManager;
|
|||||||
import ru.m.tankz.control.Control;
|
import ru.m.tankz.control.Control;
|
||||||
|
|
||||||
class NetworkControl extends HumanControl {
|
class NetworkControl extends HumanControl {
|
||||||
|
|
||||||
@:provide private var network:NetworkManager;
|
@:provide private var network:NetworkManager;
|
||||||
|
|
||||||
override public function action(action:TankAction):Void {
|
override public function action(action:TankAction):Void {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import ru.m.tankz.control.Control;
|
|||||||
import ru.m.tankz.Type;
|
import ru.m.tankz.Type;
|
||||||
|
|
||||||
class NetworkControlFactory extends BaseControlFactory {
|
class NetworkControlFactory extends BaseControlFactory {
|
||||||
|
|
||||||
override private function buildHuman(id:PlayerId, index:Int):Control {
|
override private function buildHuman(id:PlayerId, index:Int):Control {
|
||||||
return new NetworkControl(id, index);
|
return new NetworkControl(id, index);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import ru.m.tankz.proto.pack.GameEventResponse;
|
|||||||
import ru.m.tankz.proto.room.RoomSlotProto;
|
import ru.m.tankz.proto.room.RoomSlotProto;
|
||||||
|
|
||||||
class NetworkGame extends Game {
|
class NetworkGame extends Game {
|
||||||
|
|
||||||
private var network:NetworkManager;
|
private var network:NetworkManager;
|
||||||
|
|
||||||
public function new(network:NetworkManager) {
|
public function new(network:NetworkManager) {
|
||||||
@@ -39,7 +38,8 @@ class NetworkGame extends Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override private function onStart(start:Start):Void {
|
override private function onStart(start:Start):Void {
|
||||||
var slot:RoomSlotProto = Lambda.find(network.room.slots, function(slot:RoomSlotProto) return slot.hasUser() && slot.user.uuid == network.user.uuid);
|
var slot:RoomSlotProto = Lambda.find(network.room.slots,
|
||||||
|
function(slot:RoomSlotProto) return slot.hasUser() && slot.user.uuid == network.user.uuid);
|
||||||
if (slot != null) {
|
if (slot != null) {
|
||||||
start.state.controls.push({playerId: [slot.slot.team, slot.slot.index], controller: HUMAN(0)});
|
start.state.controls.push({playerId: [slot.slot.team, slot.slot.index], controller: HUMAN(0)});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ enum ConnectionState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@:provide class NetworkManager {
|
@:provide class NetworkManager {
|
||||||
|
|
||||||
private static inline var TAG = "NetworkManager";
|
private static inline var TAG = "NetworkManager";
|
||||||
|
|
||||||
public var state(default, null):ConnectionState;
|
public var state(default, null):ConnectionState;
|
||||||
@@ -91,11 +90,7 @@ enum ConnectionState {
|
|||||||
|
|
||||||
public function login(name:String, uuid:String = null):Void {
|
public function login(name:String, uuid:String = null):Void {
|
||||||
updateState(LOGIN);
|
updateState(LOGIN);
|
||||||
connection.send(new Request().setLogin(
|
connection.send(new Request().setLogin(new LoginRequest().setUuid(uuid).setName(name)));
|
||||||
new LoginRequest()
|
|
||||||
.setUuid(uuid)
|
|
||||||
.setName(name)
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logout():Void {
|
public function logout():Void {
|
||||||
@@ -107,11 +102,13 @@ enum ConnectionState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function createGame(type:String, level:Int):Void {
|
public function createGame(type:String, level:Int):Void {
|
||||||
connection.send(new Request().setRoom(new RoomRequest().setCreate(new CreateRequest().setType(type).setLevel(level))));
|
connection.send(new Request().setRoom(new RoomRequest().setCreate(new CreateRequest().setType(type)
|
||||||
|
.setLevel(level))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function joinGame(gameId:Int, restore:Bool = false):Void {
|
public function joinGame(gameId:Int, restore:Bool = false):Void {
|
||||||
connection.send(new Request().setRoom(new RoomRequest().setJoin(new JoinRequest().setGameId(gameId).setRestore(restore))));
|
connection.send(new Request().setRoom(new RoomRequest().setJoin(new JoinRequest().setGameId(gameId)
|
||||||
|
.setRestore(restore))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function selectSlot(slot:SlotProto):Void {
|
public function selectSlot(slot:SlotProto):Void {
|
||||||
@@ -127,11 +124,8 @@ enum ConnectionState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function action(tankId:Int, action:TankAction):Void {
|
public function action(tankId:Int, action:TankAction):Void {
|
||||||
connection.send(new Request().setGameEvent(new GameEventRequest().setEvent(
|
connection.send(new Request().setGameEvent(new GameEventRequest().setEvent(new GameEventProto().setTime(0)
|
||||||
new GameEventProto().setTime(0).setEvent(
|
.setEvent(Serializer.run(GameEvent.ACTION(tankId, action))))));
|
||||||
Serializer.run(GameEvent.ACTION(tankId, action))
|
|
||||||
)))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function connect():Void {
|
private function connect():Void {
|
||||||
|
|||||||
@@ -5,38 +5,35 @@ import ru.m.animate.Animate;
|
|||||||
import ru.m.animate.OnceAnimate;
|
import ru.m.animate.OnceAnimate;
|
||||||
|
|
||||||
class AnimateBundle {
|
class AnimateBundle {
|
||||||
|
|
||||||
private static function buildAnimate(name:String, sequence:Array<Int>):OnceAnimate {
|
private static function buildAnimate(name:String, sequence:Array<Int>):OnceAnimate {
|
||||||
var template:String = 'resources/image/animate/${name}/%index%.png';
|
var template:String = 'resources/image/animate/${name}/%index%.png';
|
||||||
var frames = [for (i in sequence) ({
|
var frames = [
|
||||||
image: Assets.getBitmapData(StringTools.replace(template, '%index%', Std.string(i))),
|
for (i in sequence)
|
||||||
length: 1
|
({
|
||||||
})];
|
image:Assets.getBitmapData(StringTools.replace(template, '%index%', Std.string(i))), length:1
|
||||||
|
})
|
||||||
|
];
|
||||||
return new OnceAnimate(frames);
|
return new OnceAnimate(frames);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tankSpawn():OnceAnimate {
|
public static function tankSpawn():OnceAnimate {
|
||||||
return buildAnimate('appear', [
|
return buildAnimate('appear', [0, 1, 2, 3, 3, 4, 5, 5, 6]);
|
||||||
0, 1, 2, 3, 3, 4, 5, 5, 6
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tankBoom():OnceAnimate {
|
public static function tankBoom():OnceAnimate {
|
||||||
return buildAnimate('boom', [
|
return buildAnimate('boom', [0, 1, 2, 3, 4, 4, 4, 1, 4, 4, 7, 7, 8, 9, 9]);
|
||||||
0, 1, 2, 3, 4, 4, 4, 1, 4, 4, 7, 7, 8, 9, 9
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function bulletBoom():OnceAnimate {
|
public static function bulletBoom():OnceAnimate {
|
||||||
return buildAnimate('boom-sm', [
|
return buildAnimate('boom-sm', [0, 1, 1, 0, 0, 1]);
|
||||||
0, 1, 1, 0, 0, 1
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tankProtect():Animate {
|
public static function tankProtect():Animate {
|
||||||
return new Animate([for (i in 0...2) ({
|
return new Animate([
|
||||||
image: Assets.getBitmapData('resources/image/animate/protect/${i}.png'),
|
for (i in 0...2)
|
||||||
length: 5
|
({
|
||||||
})]);
|
image:Assets.getBitmapData('resources/image/animate/protect/${i}.png'), length:5
|
||||||
|
})
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ import ru.m.tankz.render.item.EagleRenderItem;
|
|||||||
import ru.m.tankz.render.item.IRenderItem;
|
import ru.m.tankz.render.item.IRenderItem;
|
||||||
import ru.m.tankz.render.item.TankRenderItem;
|
import ru.m.tankz.render.item.TankRenderItem;
|
||||||
import ru.m.tankz.Type;
|
import ru.m.tankz.Type;
|
||||||
|
|
||||||
using ru.m.display.DisplayObjectContainerExtender;
|
using ru.m.display.DisplayObjectContainerExtender;
|
||||||
|
|
||||||
class Render extends SpriteView implements IRender {
|
class Render extends SpriteView implements IRender {
|
||||||
|
|
||||||
public var config(default, set):Config;
|
public var config(default, set):Config;
|
||||||
public var gridSize(default, set):GridSize;
|
public var gridSize(default, set):GridSize;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import openfl.Assets;
|
|||||||
import ru.m.tankz.Type;
|
import ru.m.tankz.Type;
|
||||||
|
|
||||||
class RenderUtil {
|
class RenderUtil {
|
||||||
|
|
||||||
public static function eagleImage(death:Bool = false):BitmapData {
|
public static function eagleImage(death:Bool = false):BitmapData {
|
||||||
var suffix = death ? '-death' : '';
|
var suffix = death ? '-death' : '';
|
||||||
return Assets.getBitmapData('resources/image/eagle/eagle${suffix}.png');
|
return Assets.getBitmapData('resources/image/eagle/eagle${suffix}.png');
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import ru.m.geom.Rectangle;
|
|||||||
import ru.m.tankz.Type;
|
import ru.m.tankz.Type;
|
||||||
|
|
||||||
class BonusRenderItem extends BitmapRenderItem {
|
class BonusRenderItem extends BitmapRenderItem {
|
||||||
|
|
||||||
public var type(default, set):BonusType;
|
public var type(default, set):BonusType;
|
||||||
|
|
||||||
private var d = -0.05;
|
private var d = -0.05;
|
||||||
private var alpha = 1.0;
|
private var alpha = 1.0;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import ru.m.geom.Rectangle;
|
|||||||
import ru.m.tankz.Type;
|
import ru.m.tankz.Type;
|
||||||
|
|
||||||
class BrickBitmapBundle {
|
class BrickBitmapBundle {
|
||||||
|
|
||||||
private var data:Map<String, BitmapData>;
|
private var data:Map<String, BitmapData>;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
@@ -24,10 +23,7 @@ class BrickBitmapBundle {
|
|||||||
var image = RenderUtil.brickImage(type, frame);
|
var image = RenderUtil.brickImage(type, frame);
|
||||||
var result = new BitmapData(image.width, image.height, true, 0x00000000);
|
var result = new BitmapData(image.width, image.height, true, 0x00000000);
|
||||||
for (point in cells) {
|
for (point in cells) {
|
||||||
var rect = new flash.geom.Rectangle(
|
var rect = new flash.geom.Rectangle(point.x * image.width / 2, point.y * image.height / 2, image.width / 2,
|
||||||
point.x * image.width / 2,
|
|
||||||
point.y * image.height / 2,
|
|
||||||
image.width / 2,
|
|
||||||
image.height / 2);
|
image.height / 2);
|
||||||
result.draw(image, null, null, null, rect);
|
result.draw(image, null, null, null, rect);
|
||||||
}
|
}
|
||||||
@@ -45,7 +41,6 @@ class BrickBitmapBundle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class BrickRenderItem extends BitmapRenderItem {
|
class BrickRenderItem extends BitmapRenderItem {
|
||||||
|
|
||||||
private static var bundle:BrickBitmapBundle = new BrickBitmapBundle();
|
private static var bundle:BrickBitmapBundle = new BrickBitmapBundle();
|
||||||
|
|
||||||
public var type(default, set):BrickType;
|
public var type(default, set):BrickType;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import ru.m.geom.Position;
|
|||||||
import ru.m.geom.Rectangle;
|
import ru.m.geom.Rectangle;
|
||||||
|
|
||||||
class RenderItem implements IRenderItem {
|
class RenderItem implements IRenderItem {
|
||||||
|
|
||||||
public var view(get, null):DisplayObject;
|
public var view(get, null):DisplayObject;
|
||||||
public var content(get, null):DisplayObject;
|
public var content(get, null):DisplayObject;
|
||||||
|
|
||||||
@@ -30,12 +29,22 @@ class RenderItem implements IRenderItem {
|
|||||||
rect.direction = position.direction;
|
rect.direction = position.direction;
|
||||||
if (content != null) {
|
if (content != null) {
|
||||||
content.rotation = rect.direction.angle;
|
content.rotation = rect.direction.angle;
|
||||||
content.x = - rect.width * (rect.direction.x + 1) / 2 + rect.width * (rect.direction.y + 1) / 2 + 0.5 * rect.width;
|
content.x = -rect.width * (rect.direction.x + 1) / 2
|
||||||
content.y = - rect.height * (rect.direction.x + 1) / 2 - rect.height * (rect.direction.y + 1) / 2 + 1.5 * rect.height;
|
+ rect.width * (rect.direction.y + 1) / 2
|
||||||
|
+ 0.5 * rect.width;
|
||||||
|
content.y = -rect.height * (rect.direction.x + 1) / 2
|
||||||
|
- rect.height * (rect.direction.y + 1) / 2
|
||||||
|
+ 1.5 * rect.height;
|
||||||
} else {
|
} else {
|
||||||
view.rotation = rect.direction.angle;
|
view.rotation = rect.direction.angle;
|
||||||
view.x = rect.x - rect.width * (rect.direction.x + 1) / 2 + rect.width * (rect.direction.y + 1) / 2 + 0.5 * rect.width;
|
view.x = rect.x
|
||||||
view.y = rect.y - rect.height * (rect.direction.x + 1) / 2 - rect.height * (rect.direction.y + 1) / 2 + 1.5 * rect.height;
|
- rect.width * (rect.direction.x + 1) / 2
|
||||||
|
+ rect.width * (rect.direction.y + 1) / 2
|
||||||
|
+ 0.5 * rect.width;
|
||||||
|
view.y = rect.y
|
||||||
|
- rect.height * (rect.direction.x + 1) / 2
|
||||||
|
- rect.height * (rect.direction.y + 1) / 2
|
||||||
|
+ 1.5 * rect.height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ class TankRenderItem extends BitmapRenderItem {
|
|||||||
name = value;
|
name = value;
|
||||||
nameView.text = name;
|
nameView.text = name;
|
||||||
nameView.x = (rect.width - nameView.width) / 2;
|
nameView.x = (rect.width - nameView.width) / 2;
|
||||||
nameView.y = -nameView.height / 2; //(rect.height - nameView.height) / 2;
|
nameView.y = -nameView.height / 2; // (rect.height - nameView.height) / 2;
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ import ru.m.tankz.game.IGame;
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function play(id:String):Void {
|
public function play(id:String):Void {
|
||||||
//L.d(TAG, 'play: ${id}');
|
// L.d(TAG, 'play: ${id}');
|
||||||
var sound:Sound = Assets.getSound('resources/sounds/${id}.${type}');
|
var sound:Sound = Assets.getSound('resources/sounds/${id}.${type}');
|
||||||
if (sound != null) {
|
if (sound != null) {
|
||||||
var channel = sound.play(0, 0, transform);
|
var channel = sound.play(0, 0, transform);
|
||||||
@@ -105,7 +105,7 @@ import ru.m.tankz.game.IGame;
|
|||||||
play("bullet_hit");
|
play("bullet_hit");
|
||||||
case HIT(CELL(_, _, shot)):
|
case HIT(CELL(_, _, shot)):
|
||||||
if (humanBullets.indexOf(shot.bulletId) > -1) {
|
if (humanBullets.indexOf(shot.bulletId) > -1) {
|
||||||
//play("bullet_block");
|
// play("bullet_block");
|
||||||
}
|
}
|
||||||
case DESTROY(TANK(id, _)):
|
case DESTROY(TANK(id, _)):
|
||||||
if (humanTanks.indexOf(id) > -1) {
|
if (humanTanks.indexOf(id) > -1) {
|
||||||
@@ -116,7 +116,7 @@ import ru.m.tankz.game.IGame;
|
|||||||
case DESTROY(EAGLE(_, _)):
|
case DESTROY(EAGLE(_, _)):
|
||||||
play("boom_player");
|
play("boom_player");
|
||||||
case DESTROY(BONUS(id, _)):
|
case DESTROY(BONUS(id, _)):
|
||||||
play("bonus_get");
|
// play("bonus_get");
|
||||||
if (liveBonuses.indexOf(id) > -1) {
|
if (liveBonuses.indexOf(id) > -1) {
|
||||||
play("live");
|
play("live");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import ru.m.tankz.game.PackProgress;
|
|||||||
import ru.m.tankz.Type;
|
import ru.m.tankz.Type;
|
||||||
|
|
||||||
@:provide class GameStorage extends SharedObjectStorage {
|
@:provide class GameStorage extends SharedObjectStorage {
|
||||||
|
|
||||||
private static inline var VERSION = 1;
|
private static inline var VERSION = 1;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package ru.m.tankz.storage;
|
|||||||
import hw.storage.SharedObjectStorage;
|
import hw.storage.SharedObjectStorage;
|
||||||
|
|
||||||
@:provide class NetworkStorage extends SharedObjectStorage {
|
@:provide class NetworkStorage extends SharedObjectStorage {
|
||||||
|
|
||||||
public var user(get, set):User;
|
public var user(get, set):User;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import hw.storage.SharedObjectStorage;
|
|||||||
import ru.m.tankz.game.record.GameRecord;
|
import ru.m.tankz.game.record.GameRecord;
|
||||||
|
|
||||||
@:provide class RecordStorage extends SharedObjectStorage {
|
@:provide class RecordStorage extends SharedObjectStorage {
|
||||||
|
|
||||||
private static inline var VERSION = 1;
|
private static inline var VERSION = 1;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ enum Setting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@:provide class SettingsStorage extends SharedObjectStorage {
|
@:provide class SettingsStorage extends SharedObjectStorage {
|
||||||
|
|
||||||
private static inline var VERSION = 4.1;
|
private static inline var VERSION = 4.1;
|
||||||
|
|
||||||
public var signal(default, null):Signal<Setting> = new Signal();
|
public var signal(default, null):Signal<Setting> = new Signal();
|
||||||
@@ -88,9 +87,7 @@ enum Setting {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static var mobileDefaults:Map<Int, Binding> = [
|
private static var mobileDefaults:Map<Int, Binding> = [0 => buildDeviceBinding(SCREEN),];
|
||||||
0 => buildDeviceBinding(SCREEN),
|
|
||||||
];
|
|
||||||
|
|
||||||
private static var defaults:Map<Int, Binding> = [
|
private static var defaults:Map<Int, Binding> = [
|
||||||
0 => [
|
0 => [
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import ru.m.tankz.sound.SoundManager;
|
|||||||
@:provide var resources:IResources;
|
@:provide var resources:IResources;
|
||||||
@:provide var switcher:FrameSwitcher;
|
@:provide var switcher:FrameSwitcher;
|
||||||
@:provide var soundManager:SoundManager;
|
@:provide var soundManager:SoundManager;
|
||||||
|
|
||||||
@:provide static var bus:IControlBus;
|
@:provide static var bus:IControlBus;
|
||||||
|
|
||||||
public function new():Void {
|
public function new():Void {
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import ru.m.update.Updater;
|
|||||||
using ru.m.tankz.view.ViewUtil;
|
using ru.m.tankz.view.ViewUtil;
|
||||||
|
|
||||||
@:template class MenuFrame extends FrameView<Dynamic> {
|
@:template class MenuFrame extends FrameView<Dynamic> {
|
||||||
|
|
||||||
public static var ID(default, never):String = "menu";
|
public static var ID(default, never):String = "menu";
|
||||||
|
|
||||||
@:provide static var gameInit:GameInit;
|
@:provide static var gameInit:GameInit;
|
||||||
@@ -59,7 +58,8 @@ using ru.m.tankz.view.ViewUtil;
|
|||||||
|
|
||||||
private function onSettingChange(setting:Setting):Void {
|
private function onSettingChange(setting:Setting):Void {
|
||||||
switch setting {
|
switch setting {
|
||||||
case ENABLE_NETWORK(value): networkButton.visible = value;
|
case ENABLE_NETWORK(value):
|
||||||
|
networkButton.visible = value;
|
||||||
case _:
|
case _:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import ru.m.tankz.game.record.GameRecord;
|
|||||||
import ru.m.tankz.storage.RecordStorage;
|
import ru.m.tankz.storage.RecordStorage;
|
||||||
|
|
||||||
@:template class RecordFrame extends FrameView<Dynamic> {
|
@:template class RecordFrame extends FrameView<Dynamic> {
|
||||||
|
|
||||||
public static var ID(default, never):String = "record";
|
public static var ID(default, never):String = "record";
|
||||||
|
|
||||||
@:provide static var switcher:FrameSwitcher;
|
@:provide static var switcher:FrameSwitcher;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using ru.m.tankz.view.ViewUtil;
|
|||||||
@:view("next") var nextButton:ButtonView;
|
@:view("next") var nextButton:ButtonView;
|
||||||
|
|
||||||
@:provide var frames:FrameSwitcher;
|
@:provide var frames:FrameSwitcher;
|
||||||
|
|
||||||
@:provide static var levelBundle:ILevelBundle;
|
@:provide static var levelBundle:ILevelBundle;
|
||||||
@:provide static var gameStorage:GameStorage;
|
@:provide static var gameStorage:GameStorage;
|
||||||
|
|
||||||
@@ -38,7 +39,8 @@ using ru.m.tankz.view.ViewUtil;
|
|||||||
view.winner = view.data.id.team == data.winner;
|
view.winner = view.data.id.team == data.winner;
|
||||||
}
|
}
|
||||||
levelLabel.text = data.level.toLevelLabel();
|
levelLabel.text = data.level.toLevelLabel();
|
||||||
nextButton.disabled = !gameStorage.get(result.level.packId).isPresetAvailable(result.level.id + 1, result.state.presetId);
|
nextButton.disabled = !gameStorage.get(result.level.packId)
|
||||||
|
.isPresetAvailable(result.level.id + 1, result.state.presetId);
|
||||||
nextButton.text = 'Next #${result.level.id + 1}';
|
nextButton.text = 'Next #${result.level.id + 1}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,10 @@ import ru.m.tankz.storage.SettingsStorage;
|
|||||||
|
|
||||||
private function onSettingChange(setting:Setting):Void {
|
private function onSettingChange(setting:Setting):Void {
|
||||||
switch setting {
|
switch setting {
|
||||||
case DISPLAY_FPS(value): fpsButton.on = value;
|
case DISPLAY_FPS(value):
|
||||||
case ENABLE_NETWORK(value): networkButton.on = value;
|
fpsButton.on = value;
|
||||||
|
case ENABLE_NETWORK(value):
|
||||||
|
networkButton.on = value;
|
||||||
case _:
|
case _:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ using haxe.EnumTools.EnumValueTools;
|
|||||||
using ru.m.tankz.view.ViewUtil;
|
using ru.m.tankz.view.ViewUtil;
|
||||||
|
|
||||||
@:template class StartFrame extends FrameView<Start> {
|
@:template class StartFrame extends FrameView<Start> {
|
||||||
|
|
||||||
public static var ID(default, never):String = "start";
|
public static var ID(default, never):String = "start";
|
||||||
|
|
||||||
@:provide static var switcher:FrameSwitcher;
|
@:provide static var switcher:FrameSwitcher;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import ru.m.tankz.control.Binding;
|
|||||||
import ru.m.tankz.control.Control;
|
import ru.m.tankz.control.Control;
|
||||||
|
|
||||||
class KeyboardMap {
|
class KeyboardMap {
|
||||||
|
|
||||||
private var data:Map<Int, String>;
|
private var data:Map<Int, String>;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
@@ -20,19 +19,18 @@ class KeyboardMap {
|
|||||||
this.data.set(Std.parseInt(arr[1]), arr[0]);
|
this.data.set(Std.parseInt(arr[1]), arr[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static var instance:KeyboardMap;
|
private static var instance:KeyboardMap;
|
||||||
|
|
||||||
public static function getName(key:Int):String {
|
public static function getName(key:Int):String {
|
||||||
if (instance == null) instance = new KeyboardMap();
|
if (instance == null)
|
||||||
|
instance = new KeyboardMap();
|
||||||
return key == -1 ? "(NONE)" : instance.data.exists(key) ? instance.data.get(key) : Std.string(key);
|
return key == -1 ? "(NONE)" : instance.data.exists(key) ? instance.data.get(key) : Std.string(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ViewUtil {
|
class ViewUtil {
|
||||||
|
|
||||||
public static function toLevelLabel(level:LevelConfig, oneline:Bool = false):String {
|
public static function toLevelLabel(level:LevelConfig, oneline:Bool = false):String {
|
||||||
var result:Array<String> = ['${level.packId.type} #${level.id}'];
|
var result:Array<String> = ['${level.packId.type} #${level.id}'];
|
||||||
if (level.name != null) {
|
if (level.name != null) {
|
||||||
@@ -41,7 +39,7 @@ class ViewUtil {
|
|||||||
return result.join(oneline ? " " : "\n");
|
return result.join(oneline ? " " : "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function toPackLabel(packId:PackId, separator=" #"):String {
|
public static function toPackLabel(packId:PackId, separator = " #"):String {
|
||||||
return packId.name != PackId.DEFAULT ? '${packId.type}${separator}${packId.name}' : packId.type;
|
return packId.name != PackId.DEFAULT ? '${packId.type}${separator}${packId.name}' : packId.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import ru.m.tankz.network.NetworkManager;
|
|||||||
import ru.m.tankz.view.popup.LoginPopup;
|
import ru.m.tankz.view.popup.LoginPopup;
|
||||||
|
|
||||||
@:template class NetworkStateView extends HGroupView {
|
@:template class NetworkStateView extends HGroupView {
|
||||||
|
|
||||||
@:view("state") var stateView:SpriteView;
|
@:view("state") var stateView:SpriteView;
|
||||||
@:view("user") var userLabel:LabelView;
|
@:view("user") var userLabel:LabelView;
|
||||||
@:view("login") var loginButton:ButtonView;
|
@:view("login") var loginButton:ButtonView;
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import ru.m.tankz.Type;
|
|||||||
using ru.m.tankz.view.ViewUtil;
|
using ru.m.tankz.view.ViewUtil;
|
||||||
|
|
||||||
@:template class PackView extends VGroupView {
|
@:template class PackView extends VGroupView {
|
||||||
|
|
||||||
public var data(default, set):PackId;
|
public var data(default, set):PackId;
|
||||||
|
|
||||||
@:view var label:LabelView;
|
@:view var label:LabelView;
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import ru.m.tankz.control.Controller;
|
|||||||
import ru.m.tankz.control.PlayerControl;
|
import ru.m.tankz.control.PlayerControl;
|
||||||
|
|
||||||
@:template class SlotView extends HGroupView {
|
@:template class SlotView extends HGroupView {
|
||||||
|
|
||||||
@:view("tank") public var tankView:ImageView;
|
@:view("tank") public var tankView:ImageView;
|
||||||
@:view("slot") public var slotLabel:LabelView;
|
@:view("slot") public var slotLabel:LabelView;
|
||||||
@:view("select") public var select:SelectView<Controller>;
|
@:view("select") public var select:SelectView<Controller>;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import ru.m.tankz.render.RenderUtil;
|
|||||||
import ru.m.tankz.Type.TankInfo;
|
import ru.m.tankz.Type.TankInfo;
|
||||||
|
|
||||||
class TankView extends ImageView {
|
class TankView extends ImageView {
|
||||||
|
|
||||||
public var tank(null, set):TankInfo;
|
public var tank(null, set):TankInfo;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import ru.m.tankz.Type;
|
|||||||
import ru.m.tankz.view.common.TankView;
|
import ru.m.tankz.view.common.TankView;
|
||||||
|
|
||||||
@:template class PlayerView extends VGroupView {
|
@:template class PlayerView extends VGroupView {
|
||||||
|
|
||||||
@:view("title") public var titleView:LabelView;
|
@:view("title") public var titleView:LabelView;
|
||||||
@:view("tank") public var tankView:TankView;
|
@:view("tank") public var tankView:TankView;
|
||||||
@:view("life") public var lifeLabel:LabelView;
|
@:view("life") public var lifeLabel:LabelView;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import ru.m.tankz.game.GameState;
|
|||||||
import ru.m.tankz.Type;
|
import ru.m.tankz.Type;
|
||||||
|
|
||||||
class TeamView extends DataView<PlayerState, PlayerView> {
|
class TeamView extends DataView<PlayerState, PlayerView> {
|
||||||
|
|
||||||
public var teamId(default, default):TeamId;
|
public var teamId(default, default):TeamId;
|
||||||
public var state(default, set):TeamState;
|
public var state(default, set):TeamState;
|
||||||
|
|
||||||
|
|||||||
@@ -5,38 +5,27 @@ import ru.m.geom.Direction;
|
|||||||
import ru.m.geom.Rectangle;
|
import ru.m.geom.Rectangle;
|
||||||
|
|
||||||
class DefaultActionAreaBuilder implements IActionAreaBuilder {
|
class DefaultActionAreaBuilder implements IActionAreaBuilder {
|
||||||
public function new() {
|
public function new() {}
|
||||||
}
|
|
||||||
|
|
||||||
public function build(width:Float, height:Float):Array<IActionArea> {
|
public function build(width:Float, height:Float):Array<IActionArea> {
|
||||||
var areas:Array<IActionArea> = [];
|
var areas:Array<IActionArea> = [];
|
||||||
var size = Math.min(width, height) / 7;
|
var size = Math.min(width, height) / 7;
|
||||||
var padding = size / 2;
|
var padding = size / 2;
|
||||||
// top
|
// top
|
||||||
areas.push(new RectangleActionArea(
|
areas.push(new RectangleActionArea(DIRECTION(Direction.TOP),
|
||||||
DIRECTION(Direction.TOP),
|
new Rectangle(padding + size, height - size * 3 - padding, size, size)));
|
||||||
new Rectangle(padding + size, height - size * 3 - padding, size, size)
|
|
||||||
));
|
|
||||||
// left
|
// left
|
||||||
areas.push(new RectangleActionArea(
|
areas.push(new RectangleActionArea(DIRECTION(Direction.LEFT),
|
||||||
DIRECTION(Direction.LEFT),
|
new Rectangle(padding, height - size * 2 - padding, size, size)));
|
||||||
new Rectangle(padding, height - size * 2 - padding, size, size)
|
|
||||||
));
|
|
||||||
// bottom
|
// bottom
|
||||||
areas.push(new RectangleActionArea(
|
areas.push(new RectangleActionArea(DIRECTION(Direction.BOTTOM),
|
||||||
DIRECTION(Direction.BOTTOM),
|
new Rectangle(padding + size, height - size - padding, size, size)));
|
||||||
new Rectangle(padding + size, height - size - padding, size, size)
|
|
||||||
));
|
|
||||||
// right
|
// right
|
||||||
areas.push(new RectangleActionArea(
|
areas.push(new RectangleActionArea(DIRECTION(Direction.RIGHT),
|
||||||
DIRECTION(Direction.RIGHT),
|
new Rectangle(padding + size * 2, height - size * 2 - padding, size, size)));
|
||||||
new Rectangle(padding + size * 2, height - size * 2 - padding, size, size)
|
|
||||||
));
|
|
||||||
// button
|
// button
|
||||||
areas.push(new RectangleActionArea(
|
areas.push(new RectangleActionArea(KEY(0),
|
||||||
KEY(0),
|
new Rectangle(width - size * 1.5 - padding, height - size * 2 - padding, size, size)));
|
||||||
new Rectangle(width - size * 1.5 - padding, height - size * 2 - padding, size, size)
|
|
||||||
));
|
|
||||||
return areas;
|
return areas;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import hw.view.skin.ISkin;
|
|||||||
import ru.m.control.DeviceAction;
|
import ru.m.control.DeviceAction;
|
||||||
|
|
||||||
@:style class GamepadSkin implements ISkin<GamepadView> {
|
@:style class GamepadSkin implements ISkin<GamepadView> {
|
||||||
|
|
||||||
@:style(0xffffff) public var color(default, default):Null<Color>;
|
@:style(0xffffff) public var color(default, default):Null<Color>;
|
||||||
@:style(0x00ff00) public var activeColor(default, default):Null<Color>;
|
@:style(0x00ff00) public var activeColor(default, default):Null<Color>;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import ru.m.geom.Point;
|
|||||||
import ru.m.tankz.config.Config;
|
import ru.m.tankz.config.Config;
|
||||||
|
|
||||||
class GamepadView extends SpriteView implements IControlDevice {
|
class GamepadView extends SpriteView implements IControlDevice {
|
||||||
|
|
||||||
public var type(default, null):DeviceType;
|
public var type(default, null):DeviceType;
|
||||||
public var signal(default, null):Signal2<DeviceAction, Bool>;
|
public var signal(default, null):Signal2<DeviceAction, Bool>;
|
||||||
|
|
||||||
|
|||||||
@@ -7,43 +7,30 @@ import ru.m.geom.Direction;
|
|||||||
import ru.m.geom.Rectangle;
|
import ru.m.geom.Rectangle;
|
||||||
|
|
||||||
class SmartActionAreaBuilder implements IActionAreaBuilder {
|
class SmartActionAreaBuilder implements IActionAreaBuilder {
|
||||||
public function new() {
|
public function new() {}
|
||||||
}
|
|
||||||
|
|
||||||
public function build(width:Float, height:Float):Array<IActionArea> {
|
public function build(width:Float, height:Float):Array<IActionArea> {
|
||||||
var areas:Array<IActionArea> = [];
|
var areas:Array<IActionArea> = [];
|
||||||
var size = Math.min(width, height) / 5;
|
var size = Math.min(width, height) / 5;
|
||||||
var padding = Box.fromArray([size / 4, size / 3]);
|
var padding = Box.fromArray([size / 4, size / 3]);
|
||||||
// top
|
// top
|
||||||
areas.push(new RhombusActionArea(
|
areas.push(new RhombusActionArea(DIRECTION(Direction.TOP),
|
||||||
DIRECTION(Direction.TOP),
|
new Rectangle(padding.left + size * 0.5, height - size * 2 - padding.bottom, size, size)));
|
||||||
new Rectangle(padding.left + size * 0.5, height - size * 2 - padding.bottom, size, size )
|
|
||||||
));
|
|
||||||
// left
|
// left
|
||||||
areas.push(new RhombusActionArea(
|
areas.push(new RhombusActionArea(DIRECTION(Direction.LEFT),
|
||||||
DIRECTION(Direction.LEFT),
|
new Rectangle(padding.left, height - size * 1.5 - padding.bottom, size, size)));
|
||||||
new Rectangle(padding.left, height - size * 1.5 - padding.bottom, size, size)
|
|
||||||
));
|
|
||||||
// bottom
|
// bottom
|
||||||
areas.push(new RhombusActionArea(
|
areas.push(new RhombusActionArea(DIRECTION(Direction.BOTTOM),
|
||||||
DIRECTION(Direction.BOTTOM),
|
new Rectangle(padding.left + size * 0.5, height - size - padding.bottom, size, size)));
|
||||||
new Rectangle(padding.left + size * 0.5, height - size - padding.bottom, size, size)
|
|
||||||
));
|
|
||||||
// right
|
// right
|
||||||
areas.push(new RhombusActionArea(
|
areas.push(new RhombusActionArea(DIRECTION(Direction.RIGHT),
|
||||||
DIRECTION(Direction.RIGHT),
|
new Rectangle(padding.left + size, height - size * 1.5 - padding.bottom, size, size)));
|
||||||
new Rectangle(padding.left + size, height - size * 1.5 - padding.bottom, size, size)
|
|
||||||
));
|
|
||||||
// key 0
|
// key 0
|
||||||
areas.push(new CircleActionArea(
|
areas.push(new CircleActionArea(KEY(0),
|
||||||
KEY(0),
|
new Circle(width - size * 0.5 - padding.right, height - size * 0.5 - padding.bottom, size / 2)));
|
||||||
new Circle(width - size * 0.5 - padding.right, height - size * 0.5 - padding.bottom, size / 2)
|
|
||||||
));
|
|
||||||
// key 1
|
// key 1
|
||||||
areas.push(new CircleActionArea(
|
areas.push(new CircleActionArea(KEY(1),
|
||||||
KEY(1),
|
new Circle(width - size * 0.5 - padding.right, height - size * 1.5 - padding.bottom, size / 2)));
|
||||||
new Circle(width - size * 0.5 - padding.right, height - size * 1.5 - padding.bottom, size / 2)
|
|
||||||
));
|
|
||||||
return areas;
|
return areas;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import ru.m.tankz.proto.room.RoomProto;
|
|||||||
import ru.m.tankz.proto.room.RoomSlotProto;
|
import ru.m.tankz.proto.room.RoomSlotProto;
|
||||||
|
|
||||||
@:template class RoomFrame extends FrameView<RoomProto> {
|
@:template class RoomFrame extends FrameView<RoomProto> {
|
||||||
|
|
||||||
public static inline var ID = "room";
|
public static inline var ID = "room";
|
||||||
|
|
||||||
@:view var start:ButtonView;
|
@:view var start:ButtonView;
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import hw.view.list.ListView;
|
|||||||
import ru.m.tankz.proto.room.RoomProto;
|
import ru.m.tankz.proto.room.RoomProto;
|
||||||
|
|
||||||
@:template class RoomItemView extends HGroupView implements IListItemView<RoomProto> {
|
@:template class RoomItemView extends HGroupView implements IListItemView<RoomProto> {
|
||||||
|
|
||||||
public var item_index(default, default):Int;
|
public var item_index(default, default):Int;
|
||||||
public var data(default, set):RoomProto;
|
public var data(default, set):RoomProto;
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import ru.m.tankz.network.NetworkManager;
|
|||||||
import ru.m.tankz.proto.room.RoomSlotProto;
|
import ru.m.tankz.proto.room.RoomSlotProto;
|
||||||
|
|
||||||
@:template class SlotItemView extends HGroupView implements IListItemView<RoomSlotProto> {
|
@:template class SlotItemView extends HGroupView implements IListItemView<RoomSlotProto> {
|
||||||
|
|
||||||
public var item_index(default, default):Int;
|
public var item_index(default, default):Int;
|
||||||
public var data(default, set):RoomSlotProto;
|
public var data(default, set):RoomSlotProto;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ private typedef Result = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@:template class CreateGamePopup extends PopupView<Result> {
|
@:template class CreateGamePopup extends PopupView<Result> {
|
||||||
|
|
||||||
@:view("type") var typeView:DataView<GameType, ToggleButtonView>;
|
@:view("type") var typeView:DataView<GameType, ToggleButtonView>;
|
||||||
@:view("level") var levelView:DataView<LevelConfig, ToggleButtonView>;
|
@:view("level") var levelView:DataView<LevelConfig, ToggleButtonView>;
|
||||||
|
|
||||||
@@ -30,7 +29,7 @@ private typedef Result = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function submit():Void {
|
private function submit():Void {
|
||||||
close({type:type, level:level});
|
close({type: type, level: level});
|
||||||
}
|
}
|
||||||
|
|
||||||
private function gameTypeViewFactory(index:Int, type:GameType):ToggleButtonView {
|
private function gameTypeViewFactory(index:Int, type:GameType):ToggleButtonView {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import hw.view.text.TextView;
|
|||||||
import ru.m.tankz.network.NetworkManager;
|
import ru.m.tankz.network.NetworkManager;
|
||||||
|
|
||||||
@:singleton @:template class LoginPopup extends PopupView<User> {
|
@:singleton @:template class LoginPopup extends PopupView<User> {
|
||||||
|
|
||||||
@:view var username:InputView;
|
@:view var username:InputView;
|
||||||
@:view var password:InputView;
|
@:view var password:InputView;
|
||||||
@:view var error:TextView;
|
@:view var error:TextView;
|
||||||
@@ -26,9 +25,12 @@ import ru.m.tankz.network.NetworkManager;
|
|||||||
|
|
||||||
private function onStateChange(state:ConnectionState):Void {
|
private function onStateChange(state:ConnectionState):Void {
|
||||||
switch state {
|
switch state {
|
||||||
case ONLINE(user): close(user);
|
case ONLINE(user):
|
||||||
case ERROR(error): this.error.text = LoggerUtil.printError(error);
|
close(user);
|
||||||
case _: this.error.text = null;
|
case ERROR(error):
|
||||||
|
this.error.text = LoggerUtil.printError(error);
|
||||||
|
case _:
|
||||||
|
this.error.text = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,4 @@ enum Action {
|
|||||||
EXIT;
|
EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@:singleton @:template class PausePopup extends PopupView<Action> {
|
@:singleton @:template class PausePopup extends PopupView<Action> {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import ru.m.tankz.render.RenderUtil;
|
|||||||
import ru.m.tankz.view.common.TankView;
|
import ru.m.tankz.view.common.TankView;
|
||||||
|
|
||||||
@:template class FragView extends HGroupView {
|
@:template class FragView extends HGroupView {
|
||||||
|
|
||||||
@:view("tank") var tankView:TankView;
|
@:view("tank") var tankView:TankView;
|
||||||
@:view("title") var titleView:LabelView;
|
@:view("title") var titleView:LabelView;
|
||||||
@:view("score") var scoreView:LabelView;
|
@:view("score") var scoreView:LabelView;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import ru.m.tankz.game.GameState;
|
|||||||
import ru.m.tankz.view.common.TankView;
|
import ru.m.tankz.view.common.TankView;
|
||||||
|
|
||||||
@:template class ResultPlayerView extends VGroupView {
|
@:template class ResultPlayerView extends VGroupView {
|
||||||
|
|
||||||
@:view("player") var playerView:HGroupView;
|
@:view("player") var playerView:HGroupView;
|
||||||
@:view("tank") var tankView:TankView;
|
@:view("tank") var tankView:TankView;
|
||||||
@:view("title") var titleView:LabelView;
|
@:view("title") var titleView:LabelView;
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ typedef ActionItem = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@:template class ActionView extends HGroupView implements IListItemView<ActionItem> {
|
@:template class ActionView extends HGroupView implements IListItemView<ActionItem> {
|
||||||
|
|
||||||
public var item_index(default, default):Int;
|
public var item_index(default, default):Int;
|
||||||
public var data(default, set):ActionItem;
|
public var data(default, set):ActionItem;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import ru.m.tankz.storage.SettingsStorage;
|
|||||||
import ru.m.tankz.view.settings.ActionView;
|
import ru.m.tankz.view.settings.ActionView;
|
||||||
|
|
||||||
class BindEditor {
|
class BindEditor {
|
||||||
|
|
||||||
private var editViews:Array<ActionView>;
|
private var editViews:Array<ActionView>;
|
||||||
|
|
||||||
@:provide static var bus:IControlBus;
|
@:provide static var bus:IControlBus;
|
||||||
@@ -63,8 +62,7 @@ class BindEditor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@:template class SettingsEditor extends VGroupView {
|
@:template class SettingsEditor extends VGroupView {
|
||||||
|
public var controlIndex(default, set):Int;
|
||||||
public var controlIndex(default, set): Int;
|
|
||||||
|
|
||||||
@:view var label:LabelView;
|
@:view var label:LabelView;
|
||||||
@:view var list:DataView<ActionItem, ActionView>;
|
@:view var list:DataView<ActionItem, ActionView>;
|
||||||
@@ -74,12 +72,12 @@ class BindEditor {
|
|||||||
@:provide static var bus:IControlBus;
|
@:provide static var bus:IControlBus;
|
||||||
|
|
||||||
private function refresh():Void {
|
private function refresh():Void {
|
||||||
label.text = 'Player ${controlIndex+1}';
|
label.text = 'Player ${controlIndex + 1}';
|
||||||
var binding = storage.getBinding(controlIndex);
|
var binding = storage.getBinding(controlIndex);
|
||||||
list.data = bindingToArray(binding);
|
list.data = bindingToArray(binding);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function set_controlIndex(value: Int): Int {
|
private function set_controlIndex(value:Int):Int {
|
||||||
this.controlIndex = value;
|
this.controlIndex = value;
|
||||||
refresh();
|
refresh();
|
||||||
return this.controlIndex;
|
return this.controlIndex;
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ typedef PackagesBundle = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Updater {
|
class Updater {
|
||||||
|
|
||||||
private static inline var TAG = "Update";
|
private static inline var TAG = "Update";
|
||||||
|
|
||||||
public var type(get, null):PackageType;
|
public var type(get, null):PackageType;
|
||||||
@@ -63,11 +62,9 @@ class Updater {
|
|||||||
public function check():Promise<Bool> {
|
public function check():Promise<Bool> {
|
||||||
return resolveBundle().then(function(bundle:PackagesBundle):Bool {
|
return resolveBundle().then(function(bundle:PackagesBundle):Bool {
|
||||||
this.bundle = bundle;
|
this.bundle = bundle;
|
||||||
return Lambda.exists(bundle.packages, function(item) return (
|
return Lambda.exists(bundle.packages,
|
||||||
item.platform == Device.platform &&
|
function(item) return (item.platform == Device.platform && item.type == type
|
||||||
item.type == type &&
|
&& version < Version.fromString(item.version)));
|
||||||
version < Version.fromString(item.version)
|
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,12 @@
|
|||||||
package ru.m.update;
|
package ru.m.update;
|
||||||
|
|
||||||
abstract Version(Array<Int>) {
|
abstract Version(Array<Int>) {
|
||||||
|
|
||||||
public function new(mayor:Int, minor:Int, patch:Int, snapshot:Bool = false) {
|
public function new(mayor:Int, minor:Int, patch:Int, snapshot:Bool = false) {
|
||||||
this = [
|
this = [mayor, minor, patch, snapshot ? -1 : 0,];
|
||||||
mayor,
|
|
||||||
minor,
|
|
||||||
patch,
|
|
||||||
snapshot ? -1 : 0,
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@:arrayAccess public inline function get(key:Int) return this[key];
|
@:arrayAccess public inline function get(key:Int)
|
||||||
|
return this[key];
|
||||||
|
|
||||||
public function compare(other:Version):Int {
|
public function compare(other:Version):Int {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
@@ -26,21 +21,20 @@ abstract Version(Array<Int>) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@:op(A > B) static function gt(a:Version, b:Version):Bool return a.compare(b) > 0;
|
@:op(A > B) static function gt(a:Version, b:Version):Bool
|
||||||
|
return a.compare(b) > 0;
|
||||||
|
|
||||||
@:op(A == B) static function eq(a:Version, b:Version):Bool return a.compare(b) == 0;
|
@:op(A == B) static function eq(a:Version, b:Version):Bool
|
||||||
|
return a.compare(b) == 0;
|
||||||
|
|
||||||
@:op(A < B) static function lt(a:Version, b:Version):Bool return a.compare(b) < 0;
|
@:op(A < B) static function lt(a:Version, b:Version):Bool
|
||||||
|
return a.compare(b) < 0;
|
||||||
|
|
||||||
@:from public static function fromString(value:String):Version {
|
@:from public static function fromString(value:String):Version {
|
||||||
var r = ~/(\d+)\.(\d+)\.(\d+)(-SNAPSHOT)?/;
|
var r = ~/(\d+)\.(\d+)\.(\d+)(-SNAPSHOT)?/;
|
||||||
return if (r.match(value)) {
|
return if (r.match(value)) {
|
||||||
new Version(
|
new Version(Std.parseInt(r.matched(1)), Std.parseInt(r.matched(2)), Std.parseInt(r.matched(3)),
|
||||||
Std.parseInt(r.matched(1)),
|
r.matched(4) != null);
|
||||||
Std.parseInt(r.matched(2)),
|
|
||||||
Std.parseInt(r.matched(3)),
|
|
||||||
r.matched(4) != null
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
new Version(0, 0, 0);
|
new Version(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ class Base64 {
|
|||||||
private inline static var BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
private inline static var BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
private static var codec:BaseCode;
|
private static var codec:BaseCode;
|
||||||
|
|
||||||
public function new() {
|
public function new() {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static function getCodec():BaseCode {
|
static function getCodec():BaseCode {
|
||||||
if (codec == null) {
|
if (codec == null) {
|
||||||
@@ -20,7 +18,7 @@ class Base64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function encodeBase64(content:haxe.io.Bytes):String {
|
public static function encodeBase64(content:haxe.io.Bytes):String {
|
||||||
var suffix = switch (content.length % 3){
|
var suffix = switch (content.length % 3) {
|
||||||
case 2: "=";
|
case 2: "=";
|
||||||
case 1: "==";
|
case 1: "==";
|
||||||
default: "";
|
default: "";
|
||||||
@@ -45,5 +43,4 @@ class Base64 {
|
|||||||
var bytes:Bytes = Bytes.ofString(removeNullbits(content));
|
var bytes:Bytes = Bytes.ofString(removeNullbits(content));
|
||||||
return getCodec().decodeBytes(bytes);
|
return getCodec().decodeBytes(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package ru.m;
|
package ru.m;
|
||||||
|
|
||||||
#if neko
|
#if neko
|
||||||
|
|
||||||
import haxe.Log;
|
import haxe.Log;
|
||||||
import haxe.PosInfos;
|
import haxe.PosInfos;
|
||||||
import neko.vm.Thread;
|
import neko.vm.Thread;
|
||||||
|
|
||||||
class Timer {
|
class Timer {
|
||||||
|
|
||||||
private var sleep:Float;
|
private var sleep:Float;
|
||||||
private var stopped:Bool;
|
private var stopped:Bool;
|
||||||
|
|
||||||
@@ -32,7 +30,7 @@ class Timer {
|
|||||||
|
|
||||||
public dynamic function run() {}
|
public dynamic function run() {}
|
||||||
|
|
||||||
public static function delay(f:Void -> Void, time_ms:Int) {
|
public static function delay(f:Void->Void, time_ms:Int) {
|
||||||
var t = new Timer(time_ms);
|
var t = new Timer(time_ms);
|
||||||
t.run = function() {
|
t.run = function() {
|
||||||
t.stop();
|
t.stop();
|
||||||
@@ -41,7 +39,7 @@ class Timer {
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function measure<T>(f:Void -> T, ?pos:PosInfos):T {
|
public static function measure<T>(f:Void->T, ?pos:PosInfos):T {
|
||||||
var t0 = stamp();
|
var t0 = stamp();
|
||||||
var r = f();
|
var r = f();
|
||||||
Log.trace((stamp() - t0) + "s", pos);
|
Log.trace((stamp() - t0) + "s", pos);
|
||||||
@@ -52,9 +50,6 @@ class Timer {
|
|||||||
return Sys.time();
|
return Sys.time();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
typedef Timer = haxe.Timer;
|
typedef Timer = haxe.Timer;
|
||||||
|
|
||||||
#end
|
#end
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import haxe.io.BytesInput;
|
|||||||
import protohx.Message;
|
import protohx.Message;
|
||||||
|
|
||||||
class PacketQueue<P:Message> {
|
class PacketQueue<P:Message> {
|
||||||
|
|
||||||
public var packetClass(default, null):Class<P>;
|
public var packetClass(default, null):Class<P>;
|
||||||
|
|
||||||
private var buffer:BytesBuffer;
|
private var buffer:BytesBuffer;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import haxe.io.BytesOutput;
|
|||||||
import protohx.Message;
|
import protohx.Message;
|
||||||
|
|
||||||
class PacketUtil {
|
class PacketUtil {
|
||||||
|
|
||||||
public static function fromBytes<P:Message>(bytes:Bytes, factory:Class<P>):P {
|
public static function fromBytes<P:Message>(bytes:Bytes, factory:Class<P>):P {
|
||||||
var packet:P = Type.createInstance(factory, []);
|
var packet:P = Type.createInstance(factory, []);
|
||||||
packet.mergeFrom(bytes);
|
packet.mergeFrom(bytes);
|
||||||
|
|||||||
@@ -3,15 +3,13 @@ package ru.m.connect;
|
|||||||
import haxe.io.BytesOutput;
|
import haxe.io.BytesOutput;
|
||||||
import protohx.Message;
|
import protohx.Message;
|
||||||
|
|
||||||
|
|
||||||
class WebSocketTools {
|
class WebSocketTools {
|
||||||
|
|
||||||
public static function packet2string(packet:Message):String {
|
public static function packet2string(packet:Message):String {
|
||||||
var b = new BytesOutput();
|
var b = new BytesOutput();
|
||||||
packet.writeTo(b);
|
packet.writeTo(b);
|
||||||
var data = b.getBytes();
|
var data = b.getBytes();
|
||||||
var res = new BytesOutput();
|
var res = new BytesOutput();
|
||||||
//res.writeUInt16(data.length);
|
// res.writeUInt16(data.length);
|
||||||
res.write(data);
|
res.write(data);
|
||||||
return Base64.encodeBase64(res.getBytes());
|
return Base64.encodeBase64(res.getBytes());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import sys.net.Host;
|
|||||||
import sys.net.Socket;
|
import sys.net.Socket;
|
||||||
|
|
||||||
class DesktopConnection<O:Message, I:Message> extends BaseConnection<O, I> {
|
class DesktopConnection<O:Message, I:Message> extends BaseConnection<O, I> {
|
||||||
|
|
||||||
private var host:String;
|
private var host:String;
|
||||||
private var port:Int;
|
private var port:Int;
|
||||||
private var socket:Socket;
|
private var socket:Socket;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import promhx.Promise;
|
|||||||
import protohx.Message;
|
import protohx.Message;
|
||||||
|
|
||||||
class FakeConnection<O:Message, I:Message> extends BaseConnection<O, I> {
|
class FakeConnection<O:Message, I:Message> extends BaseConnection<O, I> {
|
||||||
|
|
||||||
override public function connect():Promise<IConnection<O, I>> {
|
override public function connect():Promise<IConnection<O, I>> {
|
||||||
handler.emit(ConnectionEvent.CONNECTED);
|
handler.emit(ConnectionEvent.CONNECTED);
|
||||||
var promise:Promise<IConnection<O, I>> = cast Promise.promise(this);
|
var promise:Promise<IConnection<O, I>> = cast Promise.promise(this);
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import protohx.Message;
|
|||||||
import ru.m.connect.IConnection;
|
import ru.m.connect.IConnection;
|
||||||
|
|
||||||
class FlashConnection<O:Message, I:Message> extends BaseConnection<O, I> {
|
class FlashConnection<O:Message, I:Message> extends BaseConnection<O, I> {
|
||||||
|
|
||||||
private var host:String;
|
private var host:String;
|
||||||
private var port:Int;
|
private var port:Int;
|
||||||
private var socket:Socket;
|
private var socket:Socket;
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import protohx.Message;
|
|||||||
import ru.m.connect.IConnection;
|
import ru.m.connect.IConnection;
|
||||||
|
|
||||||
class JsConnection<O:Message, I:Message> extends BaseConnection<O, I> {
|
class JsConnection<O:Message, I:Message> extends BaseConnection<O, I> {
|
||||||
|
|
||||||
private var host:String;
|
private var host:String;
|
||||||
private var port:Int;
|
private var port:Int;
|
||||||
private var socket:WebSocket;
|
private var socket:WebSocket;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user