Deprecating plugin() function
This commit is contained in:
parent
051ccc0c6d
commit
4bc1e2f582
2 changed files with 25 additions and 14 deletions
|
@ -705,11 +705,12 @@ scload() will return the result of the last statement evaluated in the file.
|
||||||
|
|
||||||
The scsave() function saves an in-memory javascript object to a
|
The scsave() function saves an in-memory javascript object to a
|
||||||
specified file. Under the hood, scsave() uses JSON (specifically
|
specified file. Under the hood, scsave() uses JSON (specifically
|
||||||
json2.js) to save the object. Again, there will usually be no need to
|
json2.js) to save the object. There will usually be no need to call
|
||||||
call this function directly as all javascript plugins' state are saved
|
this function directly - If you want to have a javascript object
|
||||||
automatically if they are declared using the `plugin()` function. Any
|
automatically loaded at startup and saved on shutdown then use the
|
||||||
in-memory object saved using the `scsave()` function can later be
|
`persist()` module. The `persist()` module uses scsave and scload
|
||||||
restored using the `scload()` function.
|
under the hood. Any in-memory object saved using the `scsave()`
|
||||||
|
function can later be restored using the `scload()` function.
|
||||||
|
|
||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
|
@ -734,6 +735,12 @@ scsave(myObject, 'johndoe.json');
|
||||||
|
|
||||||
### plugin() function
|
### plugin() function
|
||||||
|
|
||||||
|
#### Update April 2015
|
||||||
|
The `plugin()` function is deprecated. Please refer to [Anatomy of a
|
||||||
|
ScriptCraft Plugin][anatomy] for an up-to-date step-by-step guide to
|
||||||
|
creating a plugin which uses persistence (loading and saving data).
|
||||||
|
|
||||||
|
#### Deprecated
|
||||||
The `plugin()` function should be used to declare a javascript module
|
The `plugin()` function should be used to declare a javascript module
|
||||||
whose state you want to have managed by ScriptCraft - that is - a
|
whose state you want to have managed by ScriptCraft - that is - a
|
||||||
Module whose state will be loaded at start up and saved at shut down.
|
Module whose state will be loaded at start up and saved at shut down.
|
||||||
|
@ -3311,10 +3318,7 @@ ScriptCraft uses Java's [String.format()][strfmt] so any string substitution ide
|
||||||
|
|
||||||
## Drone Plugin
|
## Drone Plugin
|
||||||
|
|
||||||
The Drone is a convenience class for building. It can be used for...
|
The Drone is a convenience class for building.
|
||||||
|
|
||||||
1. Building
|
|
||||||
2. Copying and Pasting
|
|
||||||
|
|
||||||
It uses a fluent interface which means all of the Drone's methods return `this` and can be chained together like so...
|
It uses a fluent interface which means all of the Drone's methods return `this` and can be chained together like so...
|
||||||
|
|
||||||
|
|
|
@ -230,11 +230,12 @@ scload() will return the result of the last statement evaluated in the file.
|
||||||
|
|
||||||
The scsave() function saves an in-memory javascript object to a
|
The scsave() function saves an in-memory javascript object to a
|
||||||
specified file. Under the hood, scsave() uses JSON (specifically
|
specified file. Under the hood, scsave() uses JSON (specifically
|
||||||
json2.js) to save the object. Again, there will usually be no need to
|
json2.js) to save the object. There will usually be no need to call
|
||||||
call this function directly as all javascript plugins' state are saved
|
this function directly - If you want to have a javascript object
|
||||||
automatically if they are declared using the `plugin()` function. Any
|
automatically loaded at startup and saved on shutdown then use the
|
||||||
in-memory object saved using the `scsave()` function can later be
|
`persist()` module. The `persist()` module uses scsave and scload
|
||||||
restored using the `scload()` function.
|
under the hood. Any in-memory object saved using the `scsave()`
|
||||||
|
function can later be restored using the `scload()` function.
|
||||||
|
|
||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
|
@ -259,6 +260,12 @@ scsave(myObject, 'johndoe.json');
|
||||||
|
|
||||||
### plugin() function
|
### plugin() function
|
||||||
|
|
||||||
|
#### Update April 2015
|
||||||
|
The `plugin()` function is deprecated. Please refer to [Anatomy of a
|
||||||
|
ScriptCraft Plugin][anatomy] for an up-to-date step-by-step guide to
|
||||||
|
creating a plugin which uses persistence (loading and saving data).
|
||||||
|
|
||||||
|
#### Deprecated
|
||||||
The `plugin()` function should be used to declare a javascript module
|
The `plugin()` function should be used to declare a javascript module
|
||||||
whose state you want to have managed by ScriptCraft - that is - a
|
whose state you want to have managed by ScriptCraft - that is - a
|
||||||
Module whose state will be loaded at start up and saved at shut down.
|
Module whose state will be loaded at start up and saved at shut down.
|
||||||
|
|
Reference in a new issue