From bbf14387280371450b74ebb7f4b2c2ed1a38c88c Mon Sep 17 00:00:00 2001 From: shmyga Date: Fri, 16 Aug 2019 22:39:49 +0300 Subject: [PATCH] [work] update work list --- WORK.md | 22 +++++++++++++---- src/common/haxe/ru/m/tankz/core/EntityType.hx | 24 ++++++------------- src/common/resources/config/classic.yaml | 3 ++- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/WORK.md b/WORK.md index 8c7e999..9b24ab7 100644 --- a/WORK.md +++ b/WORK.md @@ -1,8 +1,20 @@ -* bonuses in dota/death mod +* bonuses + * spawn bonus by timer + * eagle armor bonus for enemy * tanks and bullets speed balancing -* network game series -* map packs (create in editor, import in game, save imported in local storage) +* game series + * network series + * save human state in classic game +* map packs + * create in editor + * import in game + * save imported in local storage + * database * improve bots -* save human state in classic game + * A star * game config macro -* additional weapon (rockets) +* additional weapon + * mine + * display count + * bonus ammo + * screen gamepad (button enabled, count label) diff --git a/src/common/haxe/ru/m/tankz/core/EntityType.hx b/src/common/haxe/ru/m/tankz/core/EntityType.hx index b76f752..6a2a1c5 100644 --- a/src/common/haxe/ru/m/tankz/core/EntityType.hx +++ b/src/common/haxe/ru/m/tankz/core/EntityType.hx @@ -3,7 +3,6 @@ package ru.m.tankz.core; import Type; import ru.m.tankz.map.Grid; - enum EntityType { EAGLE(eagle:Eagle); TANK(tank:Tank); @@ -12,16 +11,15 @@ enum EntityType { BONUS(bonus:Bonus); } - class EntityTypeResolver { public static function of(entity:Dynamic):EntityType { - return switch (Type.typeof(entity)) { - case ValueType.TClass(Eagle): EntityType.EAGLE(cast entity); - case ValueType.TClass(Tank): EntityType.TANK(cast entity); - case ValueType.TClass(Bullet): EntityType.BULLET(cast entity); - case ValueType.TClass(GridCell): EntityType.CELL(cast entity); - case ValueType.TClass(Bonus): EntityType.BONUS(cast entity); + return switch Type.typeof(entity) { + case TClass(Eagle): EAGLE(cast entity); + case TClass(Tank): TANK(cast entity); + case TClass(Bullet): BULLET(cast entity); + case TClass(GridCell): CELL(cast entity); + case TClass(Bonus): BONUS(cast entity); case x: null; } } @@ -32,12 +30,4 @@ class EntityTypeResolver { } return null; } - - public static function asCall(entity:Entity, type:Class, fun:T->R, ?defaultResult:R):R { - var e:T = as(entity, type); - if (e != null) { - return fun(e); - } - return defaultResult; - } -} \ No newline at end of file +} diff --git a/src/common/resources/config/classic.yaml b/src/common/resources/config/classic.yaml index 1db3c1d..3b9ab7c 100644 --- a/src/common/resources/config/classic.yaml +++ b/src/common/resources/config/classic.yaml @@ -1,5 +1,6 @@ game: friendlyFire: false + alignToGrid: true map: cell: @@ -175,7 +176,7 @@ presets: teams: - {<<: *team_human} - id: bot - spawnInterval: 3000 + spawnInterval: 2000 life: 20 players: - {<<: *bot, index: 0, control: bot-stupid}