Пример #1
0
 public LightingGlobal(ScriptContext context)
     : base(context)
 {
     flashPaletteEffects = context.World.WorldActor.TraitsImplementing<FlashPaletteEffect>();
     lighting = context.World.WorldActor.TraitOrDefault<GlobalLightingPaletteEffect>();
     hasLighting = lighting != null;
 }
Пример #2
0
        public ScriptActorInterface(ScriptContext context, Actor actor)
            : base(context)
        {
            this.actor = actor;

            InitializeBindings();
        }
Пример #3
0
		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);
		}
Пример #4
0
		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 });
		}
Пример #5
0
        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);
        }
Пример #6
0
		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);
		}
Пример #7
0
		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;
		}
Пример #8
0
		public void RegisterCallback(Trigger trigger, LuaFunction func, ScriptContext context)
		{
			Triggerables(trigger).Add(new Triggerable(func, context, self));
		}
Пример #9
0
			public Triggerable(LuaFunction function, ScriptContext context, Actor self)
			{
				Function = (LuaFunction)function.CopyReference();
				Context = context;
				Self = self.ToLuaValue(Context);
			}
Пример #10
0
 public ScriptPlayerProperties(ScriptContext context, Player player)
 {
     Player  = player;
     Context = context;
 }
Пример #11
0
 public MediaGlobal(ScriptContext context)
     : base(context)
 {
     world = context.World;
     playlist = world.WorldActor.Trait<MusicPlaylist>();
 }
Пример #12
0
		public void OnScriptBind(ScriptContext context)
		{
			luaInterface = Exts.Lazy(() => new ScriptPlayerInterface(context, this));
		}
Пример #13
0
 public PlayerProperties(ScriptContext context, Player player)
     : base(context, player)
 {
 }
Пример #14
0
 public ActorGlobal(ScriptContext context)
     : base(context)
 {
 }
Пример #15
0
 public MissionObjectiveProperties(ScriptContext context, Player player)
     : base(context, player)
 {
     mo = player.PlayerActor.Trait<MissionObjectives>();
 }
Пример #16
0
		public UtilsGlobal(ScriptContext context)
			: base(context) { }
Пример #17
0
 public WDistGlobal(ScriptContext context)
     : base(context)
 {
 }
Пример #18
0
		public ReinforcementsGlobal(ScriptContext context) : base(context) { }
Пример #19
0
		public void RegisterCallback(Trigger trigger, LuaFunction func, ScriptContext context)
		{
			Triggers[trigger].Add(Pair.New((LuaFunction)func.CopyReference(), context));
		}
Пример #20
0
 public MediaGlobal(ScriptContext context)
     : base(context)
 {
     world = context.World;
 }
Пример #21
0
 public TriggerGlobal(ScriptContext context)
     : base(context)
 {
 }
Пример #22
0
 public CVecGlobal(ScriptContext context)
     : base(context)
 {
 }
Пример #23
0
 public GeneralProperties(ScriptContext context, Actor self)
     : base(context, self)
 {
     facing = self.TraitOrDefault<IFacing>();
     autotarget = self.TraitOrDefault<AutoTarget>();
     scriptTags = self.TraitOrDefault<ScriptTags>();
 }
Пример #24
0
 public HSLColorGlobal(ScriptContext context)
     : base(context)
 {
 }
Пример #25
0
 public ScriptActorProperties(ScriptContext context, Actor self)
 {
     Self    = self;
     Context = context;
 }
Пример #26
0
		public DiplomacyProperties(ScriptContext context, Player player)
			: base(context, player) { }
Пример #27
0
 public EffectGlobal(ScriptContext context)
     : base(context)
 {
     fpes = context.World.WorldActor.TraitsImplementing<FlashPaletteEffect>();
     lighting = context.World.WorldActor.TraitOrDefault<GlobalLightingPaletteEffect>();
 }
Пример #28
0
 public CallLuaFunc(LuaFunction function, ScriptContext context)
 {
     this.function = (LuaFunction)function.CopyReference();
     this.context = context;
 }
Пример #29
0
 public CaptureProperties(ScriptContext context, Actor self)
     : base(context, self)
 {
     normalInfo = Self.Info.TraitInfoOrDefault<CapturesInfo>();
     externalInfo = Self.Info.TraitInfoOrDefault<ExternalCapturesInfo>();
 }
Пример #30
0
 public CameraGlobal(ScriptContext context)
     : base(context)
 {
 }
Пример #31
0
		public PlayerGlobal(ScriptContext context) : base(context) { }
Пример #32
0
 // 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)
 {
 }
Пример #33
0
 public PlayerGlobal(ScriptContext context) : base(context)
 {
 }