(svn r23355) -Codechange: rename all AI* to Script* (Rubidium)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user