當前位置: 首頁>>代碼示例>>C#>>正文


C# OpenRA.Actor類代碼示例

本文整理匯總了C#中OpenRA.Actor的典型用法代碼示例。如果您正苦於以下問題:C# Actor類的具體用法?C# Actor怎麽用?C# Actor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Actor類屬於OpenRA命名空間,在下文中一共展示了Actor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CanPlaceBuilding

 public static bool CanPlaceBuilding(this World world, string name, BuildingInfo building, int2 topLeft, Actor toIgnore)
 {
     var res = world.WorldActor.traits.Get<ResourceLayer>();
     return !Footprint.Tiles(name, building, topLeft).Any(
         t => !world.Map.IsInMap(t.X, t.Y) || res.GetResource(t) != null || !world.IsCellBuildable(t,
             building.WaterBound, toIgnore));
 }
開發者ID:comradpara,項目名稱:OpenRA,代碼行數:7,代碼來源:WorldUtils.cs

示例2: Player

        public Player( World world, Session.Client client )
        {
            World = world;
            Shroud = new ShroudRenderer(this, world.Map);

            PlayerActor = world.CreateActor("Player", new int2(int.MaxValue, int.MaxValue), this);

            if (client != null)
            {
                Index = client.Index;
                Palette = PlayerColors[client.PaletteIndex % PlayerColors.Count()].a;
                Color = PlayerColors[client.PaletteIndex % PlayerColors.Count()].c;
                PlayerName = client.Name;
                InternalName = "Multi{0}".F(client.Index);
            }
            else
            {
                Index = -1;
                PlayerName = InternalName = "Neutral";
                Palette = "neutral";
                Color = Color.Gray;	// HACK HACK
            }

            Country = world.GetCountries()
                .FirstOrDefault(c => client != null && client.Country == c.Name)
                ?? world.GetCountries().Random(world.SharedRandom);
        }
開發者ID:comradpara,項目名稱:OpenRA,代碼行數:27,代碼來源:Player.cs

示例3: Add

 public void Add(World w, Actor a)
 {
     actors.Add(a);
     foreach (var sel in a.TraitsImplementing<INotifySelected>())
         sel.Selected(a);
     foreach (var ns in w.WorldActor.TraitsImplementing<INotifySelection>())
         ns.SelectionChanged();
 }
開發者ID:RunCraze,項目名稱:OpenRA,代碼行數:8,代碼來源:Selection.cs

示例4: PathSearch

 public PathSearch(Actor self)
 {
     this.self = self;
     world = self.World;
     cellInfo = InitCellInfo();
     mobile = self.Trait<Mobile>();
     queue = new PriorityQueue<PathDistance>();
 }
開發者ID:mgatland,項目名稱:OpenRA,代碼行數:8,代碼來源:PathSearch.cs

示例5: Tick

        public override Activity Tick(Actor self)
        {
            if (move == null || refuelsNear == null)
                return NextActivity;

            self.SetTargetLine(target, Color.Green);

            return ActivityUtils.SequenceActivities(move.MoveWithinRange(target, refuelsNear.Info.Range), NextActivity);
        }
開發者ID:obrakmann,項目名稱:oramod-wargame,代碼行數:9,代碼來源:RefuelNear.cs

示例6: Search

		public static PathSearch Search(World world, MobileInfo mi, Actor self, bool checkForBlocked)
		{
			var search = new PathSearch(world, mi, self)
			{
				CheckForBlocked = checkForBlocked
			};

			return search;
		}
開發者ID:Berzeger,項目名稱:OpenRA,代碼行數:9,代碼來源:PathSearch.cs

示例7: Order

 public Order(string orderString, Actor subject, 
     Actor targetActor, int2 targetLocation, string targetString)
 {
     this.OrderString = orderString;
     this.Subject = subject;
     this.TargetActor = targetActor;
     this.TargetLocation = targetLocation;
     this.TargetString = targetString;
 }
開發者ID:comradpara,項目名稱:OpenRA,代碼行數:9,代碼來源:Order.cs

示例8: FromPoint

        public static PathSearch FromPoint( Actor self, int2 from, int2 target, bool checkForBlocked )
        {
            var search = new PathSearch(self) {
                heuristic = DefaultEstimator( target ),
                checkForBlocked = checkForBlocked };

            search.AddInitialCell( self.World, from );
            return search;
        }
開發者ID:mgatland,項目名稱:OpenRA,代碼行數:9,代碼來源:PathSearch.cs

示例9: Order

        Order(string orderString, Actor subject,
			Actor targetActor, int2 targetLocation, string targetString, bool queued, int2 extraLocation)
        {
            this.OrderString = orderString;
            this.Subject = subject;
            this.TargetActor = targetActor;
            this.TargetLocation = targetLocation;
            this.TargetString = targetString;
            this.Queued = queued;
            this.ExtraLocation = extraLocation;
        }
開發者ID:sonygod,項目名稱:OpenRA-Dedicated-20120504,代碼行數:11,代碼來源:Order.cs

示例10: FromPoint

		public static PathSearch FromPoint(World world, MobileInfo mi, Actor self, CPos from, CPos target, bool checkForBlocked)
		{
			var search = new PathSearch(world, mi, self)
			{
				Heuristic = DefaultEstimator(target),
				CheckForBlocked = checkForBlocked
			};

			search.AddInitialCell(from);
			return search;
		}
開發者ID:Berzeger,項目名稱:OpenRA,代碼行數:11,代碼來源:PathSearch.cs

示例11: PathSearch

		public PathSearch(World world, MobileInfo mobileInfo, Actor self)
		{
			this.self = self;
			CellInfo = InitCellInfo();
			this.mobileInfo = mobileInfo;
			this.self = self;
			customCost = null;
			Queue = new PriorityQueue<PathDistance>();
			Considered = new HashSet<CPos>();
			MaxCost = 0;
			nextDirections = CVec.directions.Select(d => new Pair<CVec, int>(d, 0)).ToArray();
		}
開發者ID:Berzeger,項目名稱:OpenRA,代碼行數:12,代碼來源:PathSearch.cs

示例12: Order

        Order(string orderString, Actor subject,
			Actor targetActor, CPos targetLocation, string targetString, bool queued, CPos extraLocation, uint extraData)
        {
            this.OrderString = orderString;
            this.Subject = subject;
            this.TargetActor = targetActor;
            this.TargetLocation = targetLocation;
            this.TargetString = targetString;
            this.Queued = queued;
            this.ExtraLocation = extraLocation;
            this.ExtraData = extraData;
        }
開發者ID:ushardul,項目名稱:OpenRA,代碼行數:12,代碼來源:Order.cs

示例13: Order

        Order(string orderString, Actor subject,
			Actor targetActor, CPos targetLocation, string targetString, bool queued, CPos extraLocation, uint extraData)
        {
            OrderString = orderString;
            Subject = subject;
            TargetActor = targetActor;
            TargetLocation = targetLocation;
            TargetString = targetString;
            Queued = queued;
            ExtraLocation = extraLocation;
            ExtraData = extraData;
        }
開發者ID:pchote,項目名稱:OpenRA,代碼行數:12,代碼來源:Order.cs

示例14: FromPoints

		public static PathSearch FromPoints(World world, MobileInfo mi, Actor self, IEnumerable<CPos> froms, CPos target, bool checkForBlocked)
		{
			var search = new PathSearch(world, mi, self)
			{
				Heuristic = DefaultEstimator(target),
				CheckForBlocked = checkForBlocked
			};

			foreach (var sl in froms)
				search.AddInitialCell(sl);

			return search;
		}
開發者ID:Berzeger,項目名稱:OpenRA,代碼行數:13,代碼來源:PathSearch.cs

示例15: DoExplosion

        public static void DoExplosion(Actor attacker, string weapontype, int2 location, int altitude)
        {
            var args = new ProjectileArgs
            {
                src = location,
                dest = location,
                srcAltitude = altitude,
                destAltitude = altitude,
                firedBy = attacker,
                target = null,
                weapon = Rules.Weapons[ weapontype.ToLowerInvariant() ],
                facing = 0
            };

            DoImpacts(args, location);
        }
開發者ID:comradpara,項目名稱:OpenRA,代碼行數:16,代碼來源:Combat.cs


注:本文中的OpenRA.Actor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。