Cogs.Core
Public Member Functions | Private Attributes | List of all members
Cogs::Core::SetFieldCommand< T > Struct Template Reference
Inheritance diagram for Cogs::Core::SetFieldCommand< T >:
Cogs::Core::EditorCommand

Public Member Functions

 SetFieldCommand (EditorState *state, EntityIds entityIds, FieldInfo fieldInfo, T fieldData)
 
void close () override
 Close command, i.e. prevent merging with another command.
 
void apply () override
 Run the command.
 
void undo () override
 
bool mergeWith (const EditorCommand *command) override
 
- Public Member Functions inherited from Cogs::Core::EditorCommand
 EditorCommand (EditorState *state, Context *context)
 
virtual void apply ()=0
 Run the command.
 
virtual void undo ()=0
 
virtual void redo ()
 
virtual bool mergeWith (const EditorCommand *)
 
virtual MeshHandle applyMesh (MeshHandle)
 Workaround for having extendable mesh processing available without linking (e.g command -> RR).
 
virtual void close ()
 Close command, i.e. prevent merging with another command.
 
bool isClosed () const
 
bool merge (const EditorCommand *command)
 Merge into this if not this is closed.
 

Private Attributes

EntityIds entityIds
 
FieldInfo fieldInfo
 
fieldData
 
std::vector< T > previousDatas
 

Additional Inherited Members

- Public Attributes inherited from Cogs::Core::EditorCommand
std::vector< ParsedValueoptions
 Options passed to the command when running in batch mode.
 
bool permanentUndo = false
 True if cannot Redo after Undo.
 
- Protected Attributes inherited from Cogs::Core::EditorCommand
EditorStatestate = nullptr
 
Contextcontext = nullptr
 

Detailed Description

template<typename T>
struct Cogs::Core::SetFieldCommand< T >

Definition at line 14 of file FieldCommands.h.

Constructor & Destructor Documentation

◆ SetFieldCommand()

template<typename T >
Cogs::Core::SetFieldCommand< T >::SetFieldCommand ( EditorState state,
EntityIds  entityIds,
FieldInfo  fieldInfo,
fieldData 
)
inline

Definition at line 16 of file FieldCommands.h.

Member Function Documentation

◆ apply()

template<typename T >
void Cogs::Core::SetFieldCommand< T >::apply ( )
inlineoverridevirtual

Run the command.

In batch scripts this method is called for all type of commands. In interactive mode this method is not called for model commands (subclasses of ModalEditorCommand)

Implements Cogs::Core::EditorCommand.

Definition at line 26 of file FieldCommands.h.

References Cogs::ComponentModel::Entity::getComponent(), Cogs::Core::EntityStore::getEntityPtr(), Cogs::Reflection::TypeDatabase::getType(), and Cogs::Core::Context::store.

◆ close()

template<typename T >
void Cogs::Core::SetFieldCommand< T >::close ( )
inlineoverridevirtual

Close command, i.e. prevent merging with another command.

See also
mergeWith

Reimplemented from Cogs::Core::EditorCommand.

Definition at line 21 of file FieldCommands.h.

◆ mergeWith()

template<typename T >
bool Cogs::Core::SetFieldCommand< T >::mergeWith ( const EditorCommand )
inlineoverridevirtual

Check if the action in the given command should be merged into this. I.e. Multiple field-changes commands merged info one for undoing all-in-one. Client code shall use

See also
merge(EditorCommand * command)

Reimplemented from Cogs::Core::EditorCommand.

Definition at line 60 of file FieldCommands.h.

◆ undo()

template<typename T >
void Cogs::Core::SetFieldCommand< T >::undo ( )
inlineoverridevirtual

Implements Cogs::Core::EditorCommand.

Definition at line 43 of file FieldCommands.h.

Member Data Documentation

◆ entityIds

template<typename T >
EntityIds Cogs::Core::SetFieldCommand< T >::entityIds
private

Definition at line 82 of file FieldCommands.h.

◆ fieldData

template<typename T >
T Cogs::Core::SetFieldCommand< T >::fieldData
private

Definition at line 84 of file FieldCommands.h.

◆ fieldInfo

template<typename T >
FieldInfo Cogs::Core::SetFieldCommand< T >::fieldInfo
private

Definition at line 83 of file FieldCommands.h.

◆ previousDatas

template<typename T >
std::vector<T> Cogs::Core::SetFieldCommand< T >::previousDatas
private

Definition at line 86 of file FieldCommands.h.


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