pub enum DeclKind {
Show 22 variants
Using {
path: Vec<Name>,
global: bool,
statics: bool,
},
Namespace {
path: Vec<Name>,
body: Option<Vec<Decl>>,
},
Alias {
name: Name,
ty: Type,
},
Mod {
name: Name,
body: Vec<Decl>,
},
Event {
ty: Type,
name: Name,
},
Method(Method),
Field(Field),
Property {
ty: Type,
name: Name,
accessors: Vec<Accessor>,
value: Option<Expr>,
},
Ctor(Ctor),
Type {
word: Name,
name: Name,
value: bool,
header: TypeHeader,
body: Vec<Decl>,
},
Enum {
name: Name,
generics: Vec<Generic>,
base: Option<Type>,
variants: Vec<Variant>,
body: Vec<Decl>,
},
Unit {
name: Name,
value: Option<Expr>,
},
Content {
kind: Name,
name: Name,
header: TypeHeader,
body: Vec<Decl>,
},
Component {
name: Name,
header: TypeHeader,
body: Vec<Decl>,
},
System {
name: Name,
params: Vec<Param>,
every: Option<Expr>,
body: Block,
},
Extend {
ty: Type,
header: TypeHeader,
body: Vec<Decl>,
},
Prop(Prop),
Screen {
name: Name,
header: TypeHeader,
ui: String,
body: Vec<Decl>,
},
Command {
name: String,
body: Vec<Decl>,
},
Test {
name: String,
body: Block,
},
Patch(Patch),
Targets(VersionCond),
}Variants§
Using
using Yog.Ui;, using static Yog.Chat;, global using …;.
Namespace
namespace A.B; (the rest of the file: body None) or namespace A.B { … }.
Alias
using Grid = Dictionary<Pos, i32>;.
Mod
mod Charge { Version = "1.0.0"; … }: its properties, and members —
its constructor runs when the mod loads.
Event
public event Action<Player> Joined;.
Method(Method)
Field(Field)
Property
Ticks Left { get; set; }, Energy Room => …;.
Ctor(Ctor)
Type
class, struct, record, interface: which is word;
value: copied by value (a struct, a record struct).
Enum
enum Mode { Idle, Charging(i32 Rate) }, enum Tier : u8 { Wood = 1 }.
Unit
unit Energy; / unit FE = Energy * 1;.
Content
block Charger has Charge(1000) { … }, recipe Battery : Shaped { … },
a mod’s own kinds.
Component
System
server system Solar(Charge charge, Block block) every 1t { … }.
Extend
Prop(Prop)
Hardness = 2.0f; in a content or mod body.
Screen
Command
Test
Patch(Patch)
Targets(VersionCond)
targets mc 1.20.1..26.2;: the game versions a .yns is for.