diff options
author | truebrain <truebrain@openttd.org> | 2011-11-29 23:15:35 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-11-29 23:15:35 +0000 |
commit | 98103121d4f2ed1f1581919b7b1f343ccd410c12 (patch) | |
tree | 1e760dd6517a6b0f9fb669ec277139a8e3f9a4a3 /src/script/api/script_base.cpp | |
parent | afdb67a3534f85b4efbd3327ece8137211042d7b (diff) | |
download | openttd-98103121d4f2ed1f1581919b7b1f343ccd410c12.tar.xz |
(svn r23355) -Codechange: rename all AI* to Script* (Rubidium)
Diffstat (limited to 'src/script/api/script_base.cpp')
-rw-r--r-- | src/script/api/script_base.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/script/api/script_base.cpp b/src/script/api/script_base.cpp index 72e0ad721..5be6dd9a5 100644 --- a/src/script/api/script_base.cpp +++ b/src/script/api/script_base.cpp @@ -7,14 +7,14 @@ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. */ -/** @file script_base.cpp Implementation of AIBase. */ +/** @file script_base.cpp Implementation of ScriptBase. */ #include "../../stdafx.h" #include "script_base.hpp" #include "../../network/network.h" #include "../../core/random_func.hpp" -/* static */ uint32 AIBase::Rand() +/* static */ uint32 ScriptBase::Rand() { /* We pick RandomRange if we are in SP (so when saved, we do the same over and over) * but we pick InteractiveRandomRange if we are a network_server or network-client. */ @@ -22,12 +22,12 @@ return ::Random(); } -/* static */ uint32 AIBase::RandItem(int unused_param) +/* static */ uint32 ScriptBase::RandItem(int unused_param) { - return AIBase::Rand(); + return ScriptBase::Rand(); } -/* static */ uint AIBase::RandRange(uint max) +/* static */ uint ScriptBase::RandRange(uint max) { /* We pick RandomRange if we are in SP (so when saved, we do the same over and over) * but we pick InteractiveRandomRange if we are a network_server or network-client. */ @@ -35,17 +35,17 @@ return ::RandomRange(max); } -/* static */ uint32 AIBase::RandRangeItem(int unused_param, uint max) +/* static */ uint32 ScriptBase::RandRangeItem(int unused_param, uint max) { - return AIBase::RandRange(max); + return ScriptBase::RandRange(max); } -/* static */ bool AIBase::Chance(uint out, uint max) +/* static */ bool ScriptBase::Chance(uint out, uint max) { return (uint16)Rand() <= (uint16)((65536 * out) / max); } -/* static */ bool AIBase::ChanceItem(int unused_param, uint out, uint max) +/* static */ bool ScriptBase::ChanceItem(int unused_param, uint out, uint max) { - return AIBase::Chance(out, max); + return ScriptBase::Chance(out, max); } |