diff --git a/src/common/haxe/ru/m/tankz2/Id.hx b/src/common/haxe/ru/m/tankz2/Id.hx new file mode 100644 index 0000000..cecee59 --- /dev/null +++ b/src/common/haxe/ru/m/tankz2/Id.hx @@ -0,0 +1,4 @@ +package ru.m.tankz2; + +typedef PlayerId = Int; +typedef TeamId = String; diff --git a/src/common/haxe/ru/m/tankz2/config/Config.hx b/src/common/haxe/ru/m/tankz2/config/Config.hx new file mode 100644 index 0000000..3b9b1b0 --- /dev/null +++ b/src/common/haxe/ru/m/tankz2/config/Config.hx @@ -0,0 +1,27 @@ +package ru.m.tankz2.config; + +typedef MapConfig = { + var grid:{ + width:Int, + height:Int, + }; +} + +typedef TankConfig = { + var width:Float; + var height:Float; + var speed:Float; +} + +typedef PlayerConfig = { + +} + +typedef TeamConfig = { + var players:Array; +} + +typedef Config = { + var map:MapConfig; + var teams:Array; +} diff --git a/src/common/haxe/ru/m/tankz2/game/Game.hx b/src/common/haxe/ru/m/tankz2/game/Game.hx new file mode 100644 index 0000000..c5e9585 --- /dev/null +++ b/src/common/haxe/ru/m/tankz2/game/Game.hx @@ -0,0 +1,11 @@ +package ru.m.tankz2.game; + +import ru.m.tankz2.state.State; + +class Game { + public var state(default, null):State; + + public function new(state:State) { + this.state = state; + } +} diff --git a/src/common/haxe/ru/m/tankz2/game/Team.hx b/src/common/haxe/ru/m/tankz2/game/Team.hx new file mode 100644 index 0000000..70c610f --- /dev/null +++ b/src/common/haxe/ru/m/tankz2/game/Team.hx @@ -0,0 +1,17 @@ +package ru.m.tankz2.game; + +import ru.m.tankz2.config.Config; +import ru.m.tankz2.Id; +import ru.m.tankz2.state.State; + +class Team { + public var id(default, default):TeamId; + public var config(default, default):TeamConfig; + public var state(default, default):TeamState; + + public function new(id:TeamId, config:TeamConfig, state:TeamState) { + this.id = id; + this.config = config; + this.state = state; + } +} diff --git a/src/common/haxe/ru/m/tankz2/state/State.hx b/src/common/haxe/ru/m/tankz2/state/State.hx new file mode 100644 index 0000000..61044ac --- /dev/null +++ b/src/common/haxe/ru/m/tankz2/state/State.hx @@ -0,0 +1,13 @@ +package ru.m.tankz2.state; + +import ru.m.tankz2.config.Config; + +typedef TeamState = { + var alive:Bool; + var life:Null; +} + +typedef State = { + var config:Config; + var teams:Array; +}