コード例 #1
0
ファイル: AutoTarget.cs プロジェクト: philipbutkiewicz/OpenRA
 public AutoTarget(Actor self, AutoTargetInfo info)
 {
     this.info       = info;
     attack          = self.Trait <AttackBase>();
     Stance          = info.InitialStance;
     PredictedStance = Stance;
     at = self.TraitOrDefault <AttackFollow>();
 }
コード例 #2
0
ファイル: AttackFollow.cs プロジェクト: JackKucan/OpenRA
			public AttackActivity(Actor self, Target target, bool allowMove)
			{
				attack = self.Trait<AttackFollow>();
				move = allowMove ? self.TraitOrDefault<IMove>() : null;

				// HACK: Mobile.OnRails is horrible
				var mobile = move as Mobile;
				if (mobile != null && mobile.Info.OnRails)
					move = null;

				this.target = target;
			}
コード例 #3
0
            public AttackActivity(Actor self, Target target, bool allowMove)
            {
                attack = self.Trait <AttackFollow>();
                move   = allowMove ? self.TraitOrDefault <IMove>() : null;

                // HACK: Mobile.OnRails is horrible
                var mobile = move as Mobile;

                if (mobile != null && mobile.Info.OnRails)
                {
                    move = null;
                }

                this.target = target;
            }