2026-07-04 09:58:02 +02:00
|
|
|
import Toybox.Application;
|
|
|
|
|
import Toybox.Lang;
|
|
|
|
|
import Toybox.WatchUi;
|
|
|
|
|
|
|
|
|
|
class garmin_padelApp extends Application.AppBase {
|
2026-07-04 10:59:31 +02:00
|
|
|
private var _rules as RulesConfig;
|
|
|
|
|
private var _match as PadelMatch;
|
|
|
|
|
private var _hr as HeartRateProvider;
|
2026-07-04 09:58:02 +02:00
|
|
|
|
2026-07-04 10:59:31 +02:00
|
|
|
public function initialize() {
|
2026-07-04 09:58:02 +02:00
|
|
|
AppBase.initialize();
|
2026-07-04 10:59:31 +02:00
|
|
|
_rules = new RulesConfig();
|
|
|
|
|
_match = new PadelMatch(_rules);
|
|
|
|
|
_hr = new HeartRateProvider();
|
2026-07-04 09:58:02 +02:00
|
|
|
}
|
|
|
|
|
|
2026-07-04 10:59:31 +02:00
|
|
|
public function onStart(state as Dictionary?) as Void {
|
|
|
|
|
_hr.onStart();
|
2026-07-04 09:58:02 +02:00
|
|
|
}
|
|
|
|
|
|
2026-07-04 10:59:31 +02:00
|
|
|
public function onStop(state as Dictionary?) as Void {
|
|
|
|
|
_hr.onStop();
|
2026-07-04 09:58:02 +02:00
|
|
|
}
|
|
|
|
|
|
2026-07-04 10:59:31 +02:00
|
|
|
public function getMatch() as PadelMatch { return _match; }
|
|
|
|
|
public function getHeartRate() as HeartRateProvider { return _hr; }
|
|
|
|
|
|
|
|
|
|
public function resetMatch() as Void {
|
|
|
|
|
_match = new PadelMatch(_rules);
|
2026-07-04 09:58:02 +02:00
|
|
|
}
|
|
|
|
|
|
2026-07-04 10:59:31 +02:00
|
|
|
public function getInitialView() as [Views] or [Views, InputDelegates] {
|
|
|
|
|
return [ new garmin_padelView(), new garmin_padelDelegate() ];
|
|
|
|
|
}
|
2026-07-04 09:58:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getApp() as garmin_padelApp {
|
|
|
|
|
return Application.getApp() as garmin_padelApp;
|
2026-07-04 13:51:25 +02:00
|
|
|
}
|