/* $Id$
 *
 * Copyright (c) 1999 Xenonsoft Limited. All Rights Reserved.
 *
 * This software is protected by copyright. You are hereby notified from
 * now by reading this message. This software is also the confidential 
 * and proprietary information of Xenonsoft Limited.  ("Confidential
 * Information"). 
 *
 * This software is distributed under the Xenonsoft Public end user 
 * License ("XPeL"), where the machine-readable source code is provided 
 * under the "Open Source" model.
 * For more information, please read the file "LICENSE-XPL.txt" 
 */

// File:`ObjectCounter.java'
//
//
// Description:
//	Object counter 
// 
// Author:
//	Peter Pilgrim
//	Sun Jun 13 20:47:39 BST 1999 
// 
// RCS HEADER ``ObjectCounter.java''
// 
//	$Author$
//	$Date$
//	$Source$
//	$Revision$    $State$    $Locker$
//

package xenon.gamekit;

import java.awt.*;
import java.awt.image.*;

import xenon.gamekit.*;				// for GameEngine, WorldObject, etc

/**
 * an object counter
 */
public class ObjectCounter 
{
    private int	counter;
    
    
    /** creates an object counter */
    public ObjectCounter()
    {
	counter = 0;
    }
    
    /** increment the counter */
    public synchronized void increment(  ) 
    {
	++counter;
    }
    
    /** decrement the counter */
    public synchronized void decrement(  ) 
    {
	--counter;
    }
    
    /**
     * get the object count
     */
    public synchronized int getCount() 
    {
	return counter;
    }

    /**
     * set count value
     */
    public synchronized void setCount( int newCount) 
    {
	counter = newCount;
    }
}

// fini
