Loading...
Searching...
No Matches
CProgrammableObject Class Referenceabstract

Interface for programmable objects. More...

`#include <src/object/interface/programmable_object.h>`

Inheritance diagram for CProgrammableObject:
[legend]

## Public Member Functions

| CProgrammableObject (ObjectInterfaceTypes &types)
virtual void | RunProgram (Program *program)=0
| Start a program.
virtual void | StopProgram ()=0
| Stop currently running program.
virtual Program * | GetCurrentProgram ()=0
| Returns the currently running program, or nullptr if no program is running.
virtual bool | IsProgram ()=0
| Check if a program is running.
virtual bool | WriteStack (std::ostream &ostr)=0
| Save current execution status to file.
virtual bool | ReadStack (std::istream &istr)=0
| Read current execution status from file.
virtual void | TraceRecordStart ()=0
| Start recording trace.
virtual void | TraceRecordStop ()=0
| Stop recording trace and generate CBot program.
virtual bool | IsTraceRecord ()=0
| Returns true if trace recording is in progress.
virtual void | SetActivity (bool bMode)=0
| Management of object "activity" (temporairly stops program execution, right now used only by Aliens in eggs).
virtual bool | GetActivity ()=0
virtual float | GetCmdLine (unsigned int rank)=0
| Returns program cmdline values for an object.

## Detailed Description

Interface for programmable objects.

Programmable objects can be programmed in CBOT

## Member Function Documentation

## RunProgram()

virtual void CProgrammableObject::RunProgram | ( | Program * | program | ) |

pure virtual

Start a program.

Implemented in CProgrammableObjectImpl.

## StopProgram()

virtual void CProgrammableObject::StopProgram | ( |  | ) |

pure virtual

Stop currently running program.

Implemented in COldObject, and CProgrammableObjectImpl.

## GetCurrentProgram()

virtual Program * CProgrammableObject::GetCurrentProgram | ( |  | ) |

pure virtual

Returns the currently running program, or nullptr if no program is running.

Implemented in CProgrammableObjectImpl.

## IsProgram()

virtual bool CProgrammableObject::IsProgram | ( |  | ) |

pure virtual

Check if a program is running.

Implemented in CProgrammableObjectImpl.

## WriteStack()

virtual bool CProgrammableObject::WriteStack | ( | std::ostream & | ostr | ) |

pure virtual

Save current execution status to file.

Implemented in CProgrammableObjectImpl.

## ReadStack()

virtual bool CProgrammableObject::ReadStack | ( | std::istream & | istr | ) |

pure virtual

Read current execution status from file.

Implemented in CProgrammableObjectImpl.

## TraceRecordStart()

virtual void CProgrammableObject::TraceRecordStart | ( |  | ) |

pure virtual

Start recording trace.

Implemented in CProgrammableObjectImpl.

## TraceRecordStop()

virtual void CProgrammableObject::TraceRecordStop | ( |  | ) |

pure virtual

Stop recording trace and generate CBot program.

Implemented in CProgrammableObjectImpl.

## IsTraceRecord()

virtual bool CProgrammableObject::IsTraceRecord | ( |  | ) |

pure virtual

Returns true if trace recording is in progress.

Implemented in CProgrammableObjectImpl.

## SetActivity()

virtual void CProgrammableObject::SetActivity | ( | bool | bMode | ) |

pure virtual

Management of object "activity" (temporairly stops program execution, right now used only by Aliens in eggs).

Implemented in CProgrammableObjectImpl.

## GetCmdLine()

virtual float CProgrammableObject::GetCmdLine | ( | unsigned int | rank | ) |

pure virtual

Returns program cmdline values for an object.

Implemented in CProgrammableObjectImpl.

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

- src/object/interface/programmable_object.h