ALMaSS Partridge ODdox
1.1
The partridge model description following ODdox protocol
|
Used for messaging. More...
#include <Partridge_Communication.h>
Public Member Functions | |
void | ClearData (PartridgeCommunicationData *pc_data) |
Void data. More... | |
bool | PassMessage (PartridgeCommunicationData *pc_data, TypeOfPartridge_Communication pc) |
Pass a message. More... | |
Used for messaging.
Messages are passed between birds, and this a common cause of bugs if the information passed in inconsistent. This class therefore has two purposes - collecting messaging code together for ease of overview, and as a debug function.
Definition at line 100 of file Partridge_Communication.h.
void Partridge_Communication::ClearData | ( | PartridgeCommunicationData * | pc_data | ) |
Void data.
Just makes sure that all message fields are empty. Used before putting new data in.
Definition at line 66 of file Partridge_Communication.cpp.
References PartridgeCommunicationData::m_boolean, PartridgeCommunicationData::m_chick, PartridgeCommunicationData::m_chick2, PartridgeCommunicationData::m_clutch, PartridgeCommunicationData::m_covey, PartridgeCommunicationData::m_female, PartridgeCommunicationData::m_float, PartridgeCommunicationData::m_HaveTerritory, PartridgeCommunicationData::m_int, and PartridgeCommunicationData::m_male.
bool Partridge_Communication::PassMessage | ( | PartridgeCommunicationData * | pc_data, |
TypeOfPartridge_Communication | pc | ||
) |
Pass a message.
This passes messages listed in the TypeOfPartridge_Communication enum. It is a place that errors can be trapped but is not strictly necessary. Data is passed in PartridgeCommunicationData which can be checked agains the sender and the receiver information if __PAR_PCDEBUG is enabled.
This complex method is not really necessary, but it is a wonderful place to trap communication errors. If run-times really get to be a problem, then it might be worth dispensing with this nicety.
Definition at line 86 of file Partridge_Communication.cpp.
References g_msg, Partridge_Female::GetClutch(), Partridge_Male::GetMate(), Partridge_Female::GetMate(), Partridge_Base::GetObjectType(), Partridge_Male::GetOldMate(), Partridge_Female::GetOldMate(), PartridgeCommunicationData::m_chick, PartridgeCommunicationData::m_clutch, PartridgeCommunicationData::m_female, PartridgeCommunicationData::m_male, Partridge_Male::OnChicksDead(), Partridge_Female::OnChicksDead(), Partridge_Male::OnChicksMatured(), Partridge_Female::OnChicksMatured(), Partridge_Female::OnClutchDeath(), Partridge_Female::OnClutchMown(), Partridge_Clutch::OnEaten(), Partridge_Female::OnEggsHatch(), Partridge_Male::OnFemaleGivingUp(), Partridge_Male::OnLookAfterKids(), Partridge_Male::OnMateDying(), Partridge_Female::OnMateDying(), Partridge_Male::OnMating(), Partridge_Female::OnMating(), Partridge_Male::OnMovingHome(), Partridge_Clutch::OnMumDead(), Partridge_Female::OnSetMyClutch(), Partridge_Male::OnStoppingBreeding(), Partridge_Female::OnWaitForMale(), Partridge_Chick::OnYouAreDead(), pars_FIncubating, pars_FLaying, pars_FMakingNest, pcomm_AllChicksDead, pcomm_AllInfertile, pcomm_ChicksMature, pcomm_ClutchDead, pcomm_ClutchEaten, pcomm_ClutchMown, pcomm_EggsHatch, pcomm_FemaleGivingUp, pcomm_KillChick, pcomm_MaleDying, pcomm_Mating, pcomm_MatingM, pcomm_MovingHome, pcomm_MumDeadC, pcomm_SetClutch, pcomm_StoppingBreeding, pcomm_WaitForMale, pob_Chick, Partridge_Male::RemoveOldMate(), MapErrorMsg::Warn(), WARN_BUG, and TAnimal::WhatState().
Referenced by Partridge_Clutch::AgDying(), Partridge_Clutch::ClDeveloping(), Partridge_Population_Manager::CreateObjects(), Partridge_Population_Manager::DissolveCovey(), Partridge_Female::FDying(), Partridge_Female::FFindingTerritory(), Partridge_Female::FIncubating(), Partridge_Female::FLaying(), Partridge_Female::FMakingNest(), Partridge_Female::FStartingNewBrood(), Partridge_Male::MDying(), Partridge_Male::MFindingMate(), Partridge_Covey::OnChickDeath(), and Partridge_Covey::OnChickMature().