public override void Set(Objective obj, string field) { if (this.objective != obj && this.target != field) { FunctionWriter.Write($"scoreboard players operation {this.target} {this.objective} = {field} {obj}"); } }
public new EnumScore <T> this[string field] { get { return(new EnumScore <T>(this, field)); } set { if (value.Value != null) { FunctionWriter.Write($"scoreboard players set {field} {this} {IndexOf(value)}"); } else if (!value.Target.Equals(field) || !value.Objective.Equals(this)) { FunctionWriter.Write($"scoreboard players operation {field} {this} = {value.Target} {value.Objective}"); } } }
public void List() { FunctionWriter.Write($"tag {owner} list"); }
public static Value operator +(Value v, int i) { FunctionWriter.Write($"xp add {v.holder.owner} {i} {v.pl}"); return(v); }
public static void ResetAll(string name) { FunctionWriter.Write("scoreboard players reset " + name); }
public void Create(string criterion, TextComponent displayName) { FunctionWriter.Write($"scoreboard objectives add {this} {criterion} {displayName}"); }
public void Enable(string name) { FunctionWriter.Write($"scoreboard players enable {name} {this}"); }
public override void MergeData(NBT nbt) { FunctionWriter.Write($"data merge block {this} {nbt}"); }
public void Revoke() { FunctionWriter.Write($"advancement revoke {owner} {method} {id}"); }
public override void Set(Objective obj, string field) { FunctionWriter.Write($"scoreboard players set {field} {obj} {n}"); }
internal static void InternalWriteSourceCode( CodeTextWriter twSource, TranslateContext translateContext, PreparedInformations prepared, DebugInformationOptions debugInformationOption, bool includeAssemblyHeader) { IExtractContextHost extractContext = translateContext; if (includeAssemblyHeader) { foreach (var fileName in extractContext.EnumerateRequiredPrivateIncludeFileNames()) { twSource.WriteLine("#include \"{0}\"", fileName); } twSource.WriteLine("#include \"{0}.h\"", extractContext.Assembly.Name); twSource.SplitLine(); } WriteConstStrings(twSource, translateContext); WriteDeclaredValues(twSource, translateContext); twSource.WriteLine("//////////////////////////////////////////////////////////////////////////////////"); twSource.WriteLine("// [9-2] File scope prototypes:"); twSource.SplitLine(); // All types exclude publics and internals (for file scope prototypes) PrototypeWriter.InternalConvertToPrototypes( twSource, prepared.Types, type => !type.IsCLanguagePublicScope, field => !(field.IsPublic || field.IsFamily || field.IsFamilyOrAssembly), method => (method.IsPublic || method.IsFamily || method.IsFamilyOrAssembly) && prepared.Functions.ContainsKey(method)); twSource.WriteLine("//////////////////////////////////////////////////////////////////////////////////"); twSource.WriteLine("// [9-3] Declare static fields:"); twSource.SplitLine(); foreach (var type in prepared.Types. Where(type => !type.IsEnum)) { // All static fields foreach (var field in type.Fields. Where(field => field.IsStatic)) { twSource.WriteLine( "{0};", field.GetCLanguageStaticPrototype(true)); } twSource.SplitLine(); } foreach (var type in prepared.Types) { twSource.WriteLine("//////////////////////////////////////////////////////////////////////////////////"); twSource.WriteLine("// [9-4] Type: {0}", type.FriendlyName); twSource.SplitLine(); // All methods and constructor exclude type initializer foreach (var method in type.DeclaredMethods) { FunctionWriter.InternalConvertFromMethod( twSource, extractContext, prepared, method, debugInformationOption); } if (type.IsClass || type.IsValueType) { TypeHelperWriter.InternalConvertTypeHelper( twSource, type); } else if (type.IsInterface) { TypeHelperWriter.InternalConvertTypeHelperForInterface( twSource, type); } } twSource.SplitLine(); }
public void Remove() { FunctionWriter.Write($"scoreboard objectives remove {this}"); }
public void Create() { FunctionWriter.Write($"scoreboard objectives add {this} dummy"); }
public void Remove() { FunctionWriter.Write($"bossbar remove {this}"); }
public void Create(TextComponent displayName) { FunctionWriter.Write($"bossbar add {this} {displayName}"); }
public void GrantAll() { FunctionWriter.Write($"advancement grant {owner} everything"); }
public void Grant() { FunctionWriter.Write($"advancement grant {owner} {method} {id}"); }
public void Add(string entities) { FunctionWriter.Write($"team join {this} {entities}"); }
public void Grant(string criterion) { FunctionWriter.Write($"advancement grant {owner} only {id} {criterion}"); }
public void Create(TextComponent displayName) { FunctionWriter.Write("team add " + this + " " + displayName); }
public override void RemoveData(string path) { FunctionWriter.Write($"data remove block {this} {path}"); }
public void Create() { FunctionWriter.Write("team add " + this); }
public void Create(string criterion) { FunctionWriter.Write($"scoreboard objectives add {this} {criterion}"); }
public void Remove() { FunctionWriter.Write("team remove " + this); }
public void Remove() { FunctionWriter.Write("scoreboard objectives remove " + this); }
public void Clear() { FunctionWriter.Write("team empty " + this); }
public void Query() { FunctionWriter.Write($"xp query {holder.owner} {pl}"); }
public void Revoke(string criterion) { FunctionWriter.Write($"advancement revoke {owner} only {id} {criterion}"); }
public static Value operator --(Value v) { FunctionWriter.Write($"xp add {v.holder.owner} -1 {v.pl}"); return(v); }
public void RevokeAll() { FunctionWriter.Write($"advancement revoke {owner} everything"); }