aa
This commit is contained in:
1 parent
661f99c595
commit
badede4b8f
222 files changed
+14221
-4877
No files matched your search
@@ -0,0 +1,63 @@
|
||||
import Toybox.Lang;
|
||||
import Toybox.WatchUi;
|
||||
import Toybox.Time;
|
||||
import Toybox.Timer;
|
||||
import Toybox.System;
|
||||
|
||||
public class Card {
|
||||
public var team as enTeam;
|
||||
public var card as enCard;
|
||||
public var player as Number;
|
||||
public var remaining as Number;
|
||||
public var isActive as Boolean;
|
||||
|
||||
private var start as Number?;
|
||||
private var end as Number?;
|
||||
private var duration as Number?;
|
||||
private var _datetime as Number?;
|
||||
|
||||
// public var display as String?;
|
||||
|
||||
function initialize(tm as enTeam, cd as enCard, pl as Number, dn as Number, st as Number){
|
||||
team = tm;
|
||||
card = cd;
|
||||
start = st;
|
||||
duration = dn * 60;
|
||||
remaining = duration;
|
||||
end = start + duration;
|
||||
player = pl;
|
||||
isActive = true;
|
||||
_datetime = Time.now().value();
|
||||
|
||||
// display = Lang.format("T:$1$-P:$2$-C:G",[_team, _player]);
|
||||
|
||||
}
|
||||
|
||||
// public function timeRemaining(el as Number) as Number{
|
||||
// return end - el;
|
||||
// }
|
||||
|
||||
public function dummy(q as Boolean) as Void{}
|
||||
|
||||
public function update(el as Number) as Void{
|
||||
remaining = end - el;
|
||||
|
||||
if(end - el == 0){
|
||||
// WatchUi.pushView(new menuConfirmationDelegate(Lang.format("Card: $1$ Over",[player.format("%02d")]), false), new ConfirmationDelegate(method(:dummy)), WatchUi.SLIDE_LEFT);
|
||||
System.println(Lang.format("Card: $1$ Over",[player.format("%02d")]));
|
||||
isActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
function toDict() as Dictionary {
|
||||
return {
|
||||
"team" => team,
|
||||
"start" => start,
|
||||
"end" => end,
|
||||
"card" => card,
|
||||
"player" => player,
|
||||
"duration" => duration,
|
||||
"datetime" => _datetime
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user