30s penalties (2014 ruleset)

This commit is contained in:
Neale Pickett 2014-03-03 20:19:07 -07:00
parent 8b39896a38
commit 36c8ea6cc7
4 changed files with 10 additions and 7 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.woozle.penaltytimer" package="org.woozle.penaltytimer"
android:versionCode="6" android:versionCode="8"
android:versionName="1.3"> android:versionName="1.5">
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4" /> <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4" />
<uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="android.permission.VIBRATE"/>
<application android:label="@string/app_name" android:description="@string/description" android:icon="@drawable/ic_launcher"> <application android:label="@string/app_name" android:description="@string/description" android:icon="@drawable/ic_launcher">

View File

@ -5,7 +5,7 @@ SDK = /opt/android-sdk
ZIPALIGN = $(SDK)/tools/zipalign ZIPALIGN = $(SDK)/tools/zipalign
default: release-install default: debug-install
install: debug-install install: debug-install
debug-install: bin/PenaltyTimer-debug.apk debug-install: bin/PenaltyTimer-debug.apk

View File

@ -32,11 +32,11 @@ public class JammerButton extends TimerButton
penalized = true; penalized = true;
if (peer.penalized) { if (peer.penalized) {
// 7.4.1 -- Add a minute // 6.4.1 -- Add penaltyTime
} else { } else {
// 7.4 -- Take a minute away from the other side // 6.4 -- Take penaltyTime away from the other side
// if it goes negative, that's our time. // if it goes negative, that's our time.
long orem = peer.remaining() - 60000; long orem = peer.remaining() - (penaltyTime * 1000);
if (orem < 0) { if (orem < 0) {
set(-orem); set(-orem);

View File

@ -15,6 +15,9 @@ import java.util.*;
public class TimerButton public class TimerButton
implements OnClickListener, OnLongClickListener implements OnClickListener, OnLongClickListener
{ {
final int penaltyTime = 30;
final int maxPenalties = 7;
Button b; Button b;
Timer updateTimer; Timer updateTimer;
public long startTime = 0; public long startTime = 0;
@ -134,7 +137,7 @@ public class TimerButton
} }
public void onClick(View v) { public void onClick(View v) {
set((remaining() + 60000) % (60 * 8 * 1000)); set((remaining() + penaltyTime * 1000) % (penaltyTime * (maxPenalties + 1) * 1000));
start(); start();
} }