src/ai/api/ai_base.hpp
branchnoai
changeset 9814 be51ea0adc29
parent 9660 d0a430e8310b
child 9815 efac4d882b25
equal deleted inserted replaced
9813:9646f7e37c31 9814:be51ea0adc29
    30 	 * @return a random value between 0 and MAX(uint32).
    30 	 * @return a random value between 0 and MAX(uint32).
    31 	 */
    31 	 */
    32 	static uint32 Rand();
    32 	static uint32 Rand();
    33 
    33 
    34 	/**
    34 	/**
       
    35 	 * Get a random value.
       
    36 	 * @param unused_param This param is not used, but is needed to work with lists.
       
    37 	 * @return a random value between 0 and MAX(uint32).
       
    38 	 */
       
    39 	static uint32 RandItem(int unused_param);
       
    40 
       
    41 	/**
    35 	 * Get a random value in a range.
    42 	 * Get a random value in a range.
    36 	 * @param max the maximum value it will return.
    43 	 * @param max the maximum value it will return.
    37 	 * @return a random value between 0 .. max.
    44 	 * @return a random value between 0 .. max.
    38 	 */
    45 	 */
    39 	static uint RandRange(uint max);
    46 	static uint RandRange(uint max);
    40 
    47 
    41 	/**
    48 	/**
       
    49 	 * Get a random value in a range.
       
    50 	 * @param unused_param This param is not used, but is needed to work with lists.
       
    51 	 * @param max the maximum value it will return.
       
    52 	 * @return a random value between 0 .. max.
       
    53 	 */
       
    54 	static uint RandRangeItem(int unused_param, uint max);
       
    55 
       
    56 	/**
    42 	 * Returns approximatelly 'out' times true when called 'max' times.
    57 	 * Returns approximatelly 'out' times true when called 'max' times.
    43 	 *   After all, it is a random function.
    58 	 *   After all, it is a random function.
    44 	 * @return true if the chance worked out.
    59 	 * @return true if the chance worked out.
    45 	 */
    60 	 */
    46 	static bool Chance(uint out, uint max);
    61 	static bool Chance(uint out, uint max);
       
    62 
       
    63 	/**
       
    64 	 * Returns approximatelly 'out' times true when called 'max' times.
       
    65 	 *   After all, it is a random function.
       
    66 	 * @param unused_param This param is not used, but is needed to work with lists.
       
    67 	 * @return true if the chance worked out.
       
    68 	 */
       
    69 	static bool ChanceItem(int unused_param, uint out, uint max);
    47 };
    70 };
    48 
    71 
    49 #endif /* AI_BASE_HPP */
    72 #endif /* AI_BASE_HPP */