From 7122d9afe81624c63803bbf634e99634e71f1984 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 1 Sep 2004 21:02:44 +0000 Subject: [PATCH] Added isDraw(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3113 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/parlor/game/GameObject.dobj | 10 +++++++++- src/java/com/threerings/parlor/game/GameObject.java | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/parlor/game/GameObject.dobj b/src/java/com/threerings/parlor/game/GameObject.dobj index cfe106b39..83e942040 100644 --- a/src/java/com/threerings/parlor/game/GameObject.dobj +++ b/src/java/com/threerings/parlor/game/GameObject.dobj @@ -1,5 +1,5 @@ // -// $Id: GameObject.dobj,v 1.21 2004/03/06 11:29:19 mdb Exp $ +// $Id: GameObject.dobj,v 1.22 2004/09/01 21:02:44 ray Exp $ package com.threerings.parlor.game; @@ -129,6 +129,14 @@ public class GameObject extends PlaceObject return count; } + /** + * Returns true if the game is ended in a draw. + */ + public boolean isDraw () + { + return getWinnerCount() == getPlayerCount(); + } + /** * Returns the winner index of the first winning player for this game, * or -1 if there are no winners or the winners array is diff --git a/src/java/com/threerings/parlor/game/GameObject.java b/src/java/com/threerings/parlor/game/GameObject.java index f49a1d49d..44e8d639b 100644 --- a/src/java/com/threerings/parlor/game/GameObject.java +++ b/src/java/com/threerings/parlor/game/GameObject.java @@ -1,5 +1,5 @@ // -// $Id: GameObject.java,v 1.20 2004/08/27 02:20:14 mdb Exp $ +// $Id: GameObject.java,v 1.21 2004/09/01 21:02:44 ray Exp $ // // Narya library - tools for developing networked games // Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved @@ -168,6 +168,14 @@ public class GameObject extends PlaceObject return count; } + /** + * Returns true if the game is ended in a draw. + */ + public boolean isDraw () + { + return getWinnerCount() == getPlayerCount(); + } + /** * Returns the winner index of the first winning player for this game, * or -1 if there are no winners or the winners array is