ScummVM API documentation
Ultima::Ultima8::Process Class Referenceabstract
Inheritance diagram for Ultima::Ultima8::Process:
Ultima::Ultima8::ActorAnimProcess Ultima::Ultima8::AmbushProcess Ultima::Ultima8::AttackProcess Ultima::Ultima8::AudioProcess Ultima::Ultima8::AutoFirerProcess Ultima::Ultima8::AvatarDeathProcess Ultima::Ultima8::AvatarMoverProcess Ultima::Ultima8::BatteryChargerProcess Ultima::Ultima8::BoboBoomerProcess Ultima::Ultima8::CameraProcess Ultima::Ultima8::ClearFeignDeathProcess Ultima::Ultima8::CombatProcess Ultima::Ultima8::CreateItemProcess Ultima::Ultima8::CrosshairProcess Ultima::Ultima8::CruHealerProcess Ultima::Ultima8::CruPathfinderProcess Ultima::Ultima8::CycleProcess Ultima::Ultima8::DelayProcess Ultima::Ultima8::DestroyItemProcess Ultima::Ultima8::EggHatcherProcess Ultima::Ultima8::FadeToModalProcess Ultima::Ultima8::FireballProcess Ultima::Ultima8::GrantPeaceProcess Ultima::Ultima8::GravityProcess Ultima::Ultima8::GuardProcess Ultima::Ultima8::GumpNotifyProcess Ultima::Ultima8::HealProcess Ultima::Ultima8::InverterProcess Ultima::Ultima8::ItemSelectionProcess Ultima::Ultima8::LoiterProcess Ultima::Ultima8::MainMenuProcess Ultima::Ultima8::MusicProcess Ultima::Ultima8::PaceProcess Ultima::Ultima8::PaletteFaderProcess Ultima::Ultima8::PathfinderProcess Ultima::Ultima8::QuickAvatarMoverProcess Ultima::Ultima8::ResurrectionProcess Ultima::Ultima8::RollingThunderProcess Ultima::Ultima8::SchedulerProcess Ultima::Ultima8::SnapProcess Ultima::Ultima8::SplitItemProcess Ultima::Ultima8::SpriteProcess Ultima::Ultima8::StartCrusaderProcess Ultima::Ultima8::StartU8Process Ultima::Ultima8::SuperSpriteProcess Ultima::Ultima8::SurrenderProcess Ultima::Ultima8::TargetReticleProcess Ultima::Ultima8::TeleportToEggProcess Ultima::Ultima8::UCProcess

Public Types

enum  processflags {
  PROC_ACTIVE = 0x0001, PROC_SUSPENDED = 0x0002, PROC_TERMINATED = 0x0004, PROC_TERM_DEFERRED = 0x0008,
  PROC_FAILED = 0x0010, PROC_RUNPAUSED = 0x0020, PROC_TERM_DISPOSE = 0x0040, PROC_PREVENT_SAVE = 0x0080
}
 

Public Member Functions

virtual void run ()=0
 
 Process (ObjId _itemNum=0, uint16 type=0)
 
uint32 getProcessFlags () const
 
bool is_active () const
 
bool is_terminated () const
 
bool is_suspended () const
 
void fail ()
 terminate the process and recursively fail all processes waiting for it
 
virtual void terminate ()
 terminate the process. This wakes up all processes waiting for it.
 
void terminateDeferred ()
 terminate next frame
 
void setRunPaused ()
 run even when paused
 
void waitFor (ProcId pid)
 suspend until process 'pid' returns. If pid is 0, suspend indefinitely
 
void waitFor (Process *proc)
 suspend until process returns. If proc is 0, suspend indefinitely
 
void suspend ()
 suspend process
 
void wakeUp (uint32 result)
 Wake up when the process we were waiting for has finished.
 
virtual void onWakeUp ()
 A hook to add aditional behavior on wakeup, before anything else happens.
 
void setItemNum (ObjId it)
 
void setType (uint16 ty)
 
void setTicksPerRun (uint32 val)
 
ProcId getPid () const
 
ObjId getItemNum () const
 
uint16 getType () const
 
uint32 getTicksPerRun () const
 
virtual Common::String dumpInfo () const
 dump some info about this process to a string
 
bool loadData (Common::ReadStream *rs, uint32 version)
 load Process data
 
virtual void saveData (Common::WriteStream *ws)
 save Process data
 
bool validateWaiters () const
 

Protected Attributes

ProcId _pid
 process id
 
uint32 _flags
 
uint32 _ticksPerRun
 
ObjId _itemNum
 item we are assigned to
 
uint16 _type
 
uint32 _result
 process result
 
Std::vector< ProcId > _waiting
 

Member Enumeration Documentation

◆ processflags

Enumerator
PROC_ACTIVE 

is the process in the run-list?

PROC_SUSPENDED 

suspended? (because it's waiting)

PROC_TERM_DEFERRED 

automatically call terminate next frame

PROC_RUNPAUSED 

run even if game is paused

PROC_TERM_DISPOSE 

Dispose after termination.

PROC_PREVENT_SAVE 

When set, prevent game from saving.

Member Function Documentation

◆ validateWaiters()

bool Ultima::Ultima8::Process::validateWaiters ( ) const

Check the waiting processes. This is used after loading a game. Ensures they are all valid processes and suspended. Can't be done in loadData because the waiters may not be loaded yet at that point.

Member Data Documentation

◆ _ticksPerRun

uint32 Ultima::Ultima8::Process::_ticksPerRun
protected

how many kernel ticks between when this process should be run. not saved because it's fixed by process type and game.

◆ _waiting

Std::vector<ProcId> Ultima::Ultima8::Process::_waiting
protected

Processes waiting for this one to finish. When this process terminates, awaken them and pass them the result val.


The documentation for this class was generated from the following file: