Enforce Script Syntax – DayZ

From Bohemia Interactive Community
Jump to navigation Jump to search
(Base version)
 
(Added operators)
Line 1: Line 1:
__TOC__
Enscript is the language that is used by the Enfusion engine first introduced in DayZ Standalone. It is a Object-Oriented Scripting Language (OOP) that works with objects and classes.
Enscript is the language that is used by the Enfusion engine first introduced in DayZ Standalone. It is a Object-Oriented Scripting Language (OOP) that works with objects and classes.


Operators
== Operators ==
 
=== Arithmetic Operators ===
Add {{Inline code|+}}<br>
Subtract {{Inline code|-}}<br>
Multiply {{Inline code|*}}<br>
Divide {{Inline code|/}}<br>
 
=== Assignments ===
Define value to variable {{Inline code|{{=}}}}<br>
Increment variable by value {{Inline code|+{{=}}}}<br>
Decrement variable by value {{Inline code|-{{=}}}}<br>
Multiply variable by value {{Inline code|*{{=}}}}<br>
Divide variable by value {{Inline code|/{{=}}}}<br>
Increment variable by 1 {{Inline code|++}}<br>
Decrement variable by 1 {{Inline code|--}}<br>
 
=== Comparison ===
More than value {{Inline code|>}}<br>
Less than value {{Inline code|<}}<br>
More or equal to the value {{Inline code|>{{=}}}}<br>
Less or equal to the value {{Inline code|<{{=}}}}<br>
 
== Classes and Objects ==
 
Classes can be seen as a blueprint of an object. An object is an instance of a class. A class can have more than one object.
 
Instantiate (create a new instance) a class {{Inline code|MyClass myClass {{=}} new MyClass();}}<br>
Access attributes and methods inside a class by using dot notation. {{Inline code|myClass.myMethod()}}<br>
 
'''Basic Class'''
 
 
  class MyClass {
    private string _test;
    void MyClass() {
        // Constructor that will be called when class gets instantiated
    }
    string getTest() {
        return _test;
    }
    string setTest(value) {
        _test = value;
    }
}

Revision as of 01:22, 15 December 2018

Enscript is the language that is used by the Enfusion engine first introduced in DayZ Standalone. It is a Object-Oriented Scripting Language (OOP) that works with objects and classes.

Operators

Arithmetic Operators

Add +
Subtract -
Multiply *
Divide /

Assignments

Define value to variable =
Increment variable by value +=
Decrement variable by value -=
Multiply variable by value *=
Divide variable by value /=
Increment variable by 1 ++
Decrement variable by 1 --

Comparison

More than value >
Less than value <
More or equal to the value >=
Less or equal to the value <=

Classes and Objects

Classes can be seen as a blueprint of an object. An object is an instance of a class. A class can have more than one object.

Instantiate (create a new instance) a class MyClass myClass = new MyClass();
Access attributes and methods inside a class by using dot notation. myClass.myMethod()

Basic Class


 class MyClass {
    private string _test;

    void MyClass() {
        // Constructor that will be called when class gets instantiated
    }

    string getTest() {
        return _test;
    }

    string setTest(value) {
        _test = value;
    }
}