Make it possible for external entities to check whether or not the robot

tester is activated.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3180 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2004-10-28 18:53:26 +00:00
parent cec4e340d4
commit aae20e9918
@@ -1,5 +1,5 @@
// //
// $Id: PuzzlePanel.java,v 1.6 2004/10/28 18:37:49 mdb Exp $ // $Id: PuzzlePanel.java,v 1.7 2004/10/28 18:53:26 mdb Exp $
// //
// Narya library - tools for developing networked games // Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved // Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -182,7 +182,7 @@ public abstract class PuzzlePanel extends JPanel
{ {
// make the first player a robot player // make the first player a robot player
if (_robotTest.getValue() && _controller.getPlayerIndex() == 0) { if (isRobotTesting() && _controller.getPlayerIndex() == 0) {
setRobotPlayer(true); setRobotPlayer(true);
} }
} }
@@ -193,7 +193,7 @@ public abstract class PuzzlePanel extends JPanel
public void clearAction () public void clearAction ()
{ {
// deactivate the robot player // deactivate the robot player
if (_robotTest.getValue() && _controller.getPlayerIndex() == 0) { if (isRobotTesting() && _controller.getPlayerIndex() == 0) {
setRobotPlayer(false); setRobotPlayer(false);
} }
} }
@@ -247,6 +247,12 @@ public abstract class PuzzlePanel extends JPanel
return _controller; return _controller;
} }
/** Returns true if the robot tester is activated. */
public static boolean isRobotTesting ()
{
return _robotTest.getValue();
}
/** Our puzzle context. */ /** Our puzzle context. */
protected PuzzleContext _ctx; protected PuzzleContext _ctx;