public LightingGlobal(ScriptContext context) : base(context) { flashPaletteEffects = context.World.WorldActor.TraitsImplementing<FlashPaletteEffect>(); lighting = context.World.WorldActor.TraitOrDefault<GlobalLightingPaletteEffect>(); hasLighting = lighting != null; }
public ScriptActorInterface(ScriptContext context, Actor actor) : base(context) { this.actor = actor; InitializeBindings(); }
public MapGlobal(ScriptContext context) : base(context) { sma = context.World.WorldActor.Trait<SpawnMapActors>(); // Register map actors as globals (yuck!) foreach (var kv in sma.Actors) context.RegisterMapActor(kv.Key, kv.Value); }
public ScriptGlobal(ScriptContext context) : base(context) { // The 'this.' resolves the actual (subclass) type var type = this.GetType(); var names = type.GetCustomAttributes<ScriptGlobalAttribute>(true); if (names.Count() != 1) throw new InvalidOperationException("[LuaGlobal] attribute not found for global table '{0}'".F(type)); Name = names.First().Name; Bind(new[] { this }); }
public ScriptPlayerInterface(ScriptContext context, Player player) : base(context) { this.player = player; var args = new object[] { context, player }; var objects = context.PlayerCommands.Select(cg => { var groupCtor = cg.GetConstructor(new Type[] { typeof(ScriptContext), typeof(Player) }); return groupCtor.Invoke(args); }); Bind(objects); }
public ScriptActorInterface(ScriptContext context, Actor actor) : base(context) { this.actor = actor; var args = new [] { actor }; var objects = context.ActorCommands[actor.Info].Select(cg => { var groupCtor = cg.GetConstructor(new Type[] { typeof(Actor) }); return groupCtor.Invoke(args); }); Bind(objects); }
public ScriptMemberWrapper(ScriptContext context, object target, MemberInfo mi) { this.context = context; Target = target; Member = mi; var property = mi as PropertyInfo; if (property != null) { IsGetProperty = property.GetGetMethod() != null; IsSetProperty = property.GetSetMethod() != null; } else IsMethod = true; }
public void RegisterCallback(Trigger trigger, LuaFunction func, ScriptContext context) { Triggerables(trigger).Add(new Triggerable(func, context, self)); }
public Triggerable(LuaFunction function, ScriptContext context, Actor self) { Function = (LuaFunction)function.CopyReference(); Context = context; Self = self.ToLuaValue(Context); }
public ScriptPlayerProperties(ScriptContext context, Player player) { Player = player; Context = context; }
public MediaGlobal(ScriptContext context) : base(context) { world = context.World; playlist = world.WorldActor.Trait<MusicPlaylist>(); }
public void OnScriptBind(ScriptContext context) { luaInterface = Exts.Lazy(() => new ScriptPlayerInterface(context, this)); }
public PlayerProperties(ScriptContext context, Player player) : base(context, player) { }
public ActorGlobal(ScriptContext context) : base(context) { }
public MissionObjectiveProperties(ScriptContext context, Player player) : base(context, player) { mo = player.PlayerActor.Trait<MissionObjectives>(); }
public UtilsGlobal(ScriptContext context) : base(context) { }
public WDistGlobal(ScriptContext context) : base(context) { }
public ReinforcementsGlobal(ScriptContext context) : base(context) { }
public void RegisterCallback(Trigger trigger, LuaFunction func, ScriptContext context) { Triggers[trigger].Add(Pair.New((LuaFunction)func.CopyReference(), context)); }
public MediaGlobal(ScriptContext context) : base(context) { world = context.World; }
public TriggerGlobal(ScriptContext context) : base(context) { }
public CVecGlobal(ScriptContext context) : base(context) { }
public GeneralProperties(ScriptContext context, Actor self) : base(context, self) { facing = self.TraitOrDefault<IFacing>(); autotarget = self.TraitOrDefault<AutoTarget>(); scriptTags = self.TraitOrDefault<ScriptTags>(); }
public HSLColorGlobal(ScriptContext context) : base(context) { }
public ScriptActorProperties(ScriptContext context, Actor self) { Self = self; Context = context; }
public DiplomacyProperties(ScriptContext context, Player player) : base(context, player) { }
public EffectGlobal(ScriptContext context) : base(context) { fpes = context.World.WorldActor.TraitsImplementing<FlashPaletteEffect>(); lighting = context.World.WorldActor.TraitOrDefault<GlobalLightingPaletteEffect>(); }
public CallLuaFunc(LuaFunction function, ScriptContext context) { this.function = (LuaFunction)function.CopyReference(); this.context = context; }
public CaptureProperties(ScriptContext context, Actor self) : base(context, self) { normalInfo = Self.Info.TraitInfoOrDefault<CapturesInfo>(); externalInfo = Self.Info.TraitInfoOrDefault<ExternalCapturesInfo>(); }
public CameraGlobal(ScriptContext context) : base(context) { }
public PlayerGlobal(ScriptContext context) : base(context) { }
// Note: This class must not make any trait queries so that this // remains safe to call on dead actors. public BaseActorProperties(ScriptContext context, Actor self) : base(context, self) { }