Ejemplo n.º 1
0
uint8 Unit::getRace(bool forceoriginal) const
{
    if (GetTypeId() == TYPEID_PLAYER)
    {
        Player* pPlayer = ((Player*)this);

        if (forceoriginal)
            return pPlayer->getORace();

        if (pPlayer->InArena())
            return GetByteValue(UNIT_FIELD_BYTES_0, 0);

        if (!pPlayer->IsPlayingNative())
            return pPlayer->getFRace();
    }

    return GetByteValue(UNIT_FIELD_BYTES_0, 0);
}
Ejemplo n.º 2
0
Configuration::Configuration(std::string path)
: ConfigurationReader(path) {

	hostSpeed = GetDoubleValue("Host.speed", 2900.0);

	processorLevel = GetProcessorTypeValue("CPU.level");
	speed = GetDoubleValue("CPU.speed", 2.0);
	pollIntervalMilliseconds = GetIntValue("CPU.pollIntervalMilliseconds", 10);

	inputAddress = GetUShortValue("IO.inputAddress");
	outputAddress = GetUShortValue("IO.outputAddress");

	romPath = GetStringValue("ROM.path");
	romLoadAddress = GetUShortValue("ROM.loadAddress");

	ramPath = GetStringValue("RAM.path");
	ramLoadAddress = GetUShortValue("RAM.loadAddress");

	bbcLanguageRomPath = GetStringValue("BBC.language.path");
	bbcOSRomPath = GetStringValue("BBC.OS.path");
	bbcVduEmulation = GetBooleanValue("BBC.VDUEmulation");

	startAddress = GetUShortValue("run.startAddress");
	resetStart = GetBooleanValue("run.resetStart");
	stopBreak = GetBooleanValue("run.stopBreak");
	breakInstruction = GetByteValue("run.breakInstruction", 0x00);
	stopWhenLoopDetected = GetBooleanValue("run.stopWhenLoopDetected");
	stopAddress = GetUShortValue("run.stopAddress");
	stopAddressEnabled = stopAddress != 0;

#ifdef _DEBUG
	disassemble = GetBooleanValue("debug.disassemble");
	disassemblyLogPath = GetStringValue("debug.disassemblyLogPath");
	debugFile = GetStringValue("debug.debugFile");
	countInstructions = GetBooleanValue("debug.countInstructions");
	profileAddresses = GetBooleanValue("debug.profileAddresses");
#else
	disassemble = GetBooleanValue("release.disassemble");
	disassemblyLogPath = GetStringValue("release.disassemblyLogPath");
	debugFile = GetStringValue("release.debugFile");
	countInstructions = GetBooleanValue("release.countInstructions");
	profileAddresses = GetBooleanValue("release.profileAddresses");
#endif
}
Ejemplo n.º 3
0
void CPlayer::SetFakeValues()
{
    m_oRace = GetByteValue(UNIT_FIELD_BYTES_0, 0);
    m_oFaction = GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE);

    m_fRace = sCustom.PickFakeRace(getClass(), GetOTeam());
    m_fFaction = Player::getFactionForRace(m_fRace);

    m_oPlayerBytes = GetUInt32Value(PLAYER_BYTES);
    m_oPlayerBytes2 = GetUInt32Value(PLAYER_BYTES_2);
    m_fPlayerBytes = sCustom.GetFakePlayerBytes(m_fRace, getGender());
    m_fPlayerBytes2 = sCustom.GetFakePlayerBytes2(m_fRace, getGender());

    if (!m_fPlayerBytes)
        m_fPlayerBytes = m_oPlayerBytes;

    if (!m_fPlayerBytes2)
        m_fPlayerBytes2 = m_oPlayerBytes2;
}
Ejemplo n.º 4
0
uint8_t ConfigurationReader::GetByteValue(const boost::property_tree::ptree& root, std::string path) {
	return GetByteValue(root, path, 0);
}
Ejemplo n.º 5
0
uint8_t ConfigurationReader::GetByteValue(std::string path) {
	return GetByteValue(path, 0);
}
Ejemplo n.º 6
0
uint8_t ConfigurationReader::GetByteValue(std::string path, uint8_t defaultValue) {
	return GetByteValue(m_root, path, defaultValue);
}