Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 1.84 KB

README.md

File metadata and controls

60 lines (40 loc) · 1.84 KB

Binary Tactics: Client-Side implementation #2

Debugging options

Events

To control if all raised events are to be published to console toggle property:

bt.debugging.events.publishToConsole = true | false;

To set if model-view objects check received structure when initializing toggle property:

bt.debugging.model.verifyModelConstructors = true | false

Service calls stress testing:

The 'debugging view' allows for stress testing with supported service calls. Select service's method to call, set the interval at witch to call it and you get statistics of successfull, failed and error calls in real time ...

Service calls syntax from console:

Reinitialize battle view's view-model:

    bt.services.execute('BattleService', function(service) { service.initialization.initialize(); });

Update battle view's view-model:

    bt.services.execute('BattleService', function(service) { bt.game.battle.battleField.update(service) });

Update battle view's timers:

    bt.services.execute('BattleService', function(service) { bt.game.battle.timers.query(service) });

Perform action - Pass turn:

    bt.services.execute('BattleService', function(service) { service.actions.pass(); });

Perform action - Move unit:

    var unitId = 0, location = { x: 0, y: 0}; // Set these variables to appropriate values
    bt.services.execute('BattleService', function(service) { service.actions.move(unitId, location); });

Perform action - Attack unit:

    var unitId = 0, location = { x: 0, y: 0}; // Set these variables to appropriate values
    bt.services.execute('BattleService', function(service) { service.actions.attack(unitId, location); });