当前位置: 首页>>代码示例>>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;未经允许,请勿转载。