src/ai/core/ai_base.hpp
author truelight
Tue, 13 Mar 2007 21:55:22 +0000
branchnoai
changeset 9365 c3d08e0b1083
parent 9362 3aebc515446a
child 9387 4255a0a2d272
permissions -rw-r--r--
(svn r9151) [NoAI] -Add: added squirrel module that loads squirrel scripts and
executes them. For now it only spams the consule with "gameLoop"
/* $Id$ */

/** @file declaration of class for AIBase class */

#ifndef AI_BASE_HPP
#define AI_BASE_HPP

#include "ai_object.hpp"

class AIBase: public AIObject {
public:
	/**
	 * Get a random value.
	 * @return A random value between 0 and MAX(uint32)
	 */
#if defined(RANDOM_DEBUG)
	uint32 DoRandom(int line, const char *file);
#else
	uint32 Random();
#endif

	/**
	 * Get a random value in a range.
	 * @param max The maximum value it will return.
	 * @return A random value between 0 .. max.
	 */
#if defined(RANDOM_DEBUG)
	uint DoRandomRange(uint max, int line, const char *file);
#else
	uint RandomRange(uint max);
#endif

	/**
	 * Take a chance of 'out' out of 'max'.
	 * @param out How many times is should return true.
	 * @param max What the max value of 'out' can be.
	 * @return True if the chance worked out.
	 */
	bool Chance(uint out, uint max);
};

#endif /* AI_BASE_HPP */