Skip to content

cop_observer_string

Kamran Wali edited this page Nov 29, 2024 · 2 revisions

Class Name: COP_ObserverString

Inherits: Resource

Description

cop_observer_string class stores and shares the reference to a String type. When the value has been changed then the changed value will also be emitted to its observers through the callables in the Singal. This class works as the Observer Pattern. The value can NOT be set during editor mode but it can ONLY be set during run time.

Tutorial

Properties

Type Name Default Value
String _value

Methods

Return Type Name
String get_value()
String get_value_emit()
void set_value( String value )
void set_value_emit( String value )
void disconnect_all()

Signals

value_changed ( String value )

Emitted when the _value has been changed through the method set_value_emit().


Property Descriptions

String _value

The stored value that will be sent to obeservers when ever this value changes through the method set_value_emit(). This value is also emitted to observers when the method get_value_emit() is called. You can also get/set the value without the need for emitting by calling the methods get_value() or set_value()


Method Descriptions

String get_value ()

This method returns the _value without emitting to the observers.


String get_value_emit ()

This method returns the _value and emits it to the observers.


void set_value ( String value )

This method sets the _value without emitting to the obserers.


void set_value_emit ( String value )

This method sets the _value and emits it to the observers.


void disconnect_all ()

This method removes/disconnects all the connected callable objects from the Signal value_changed.


Clone this wiki locally