当前位置: 首页>>代码示例>>C#>>正文


C# ITile类代码示例

本文整理汇总了C#中ITile的典型用法代码示例。如果您正苦于以下问题:C# ITile类的具体用法?C# ITile怎么用?C# ITile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ITile类属于命名空间,在下文中一共展示了ITile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Swap

 public void Swap(IList<ITile> tiles, ITile first, ITile second)
 {
     int firstIndex = tiles.IndexOf(first);
     int secondIndex = tiles.IndexOf(second);
     if (firstIndex == -1 || secondIndex == -1)
         return;
     tiles[firstIndex] = second;
     tiles[secondIndex] = first;
 }
开发者ID:djpereira,项目名称:Caliburn.Micro-TileOrderMVVM,代码行数:9,代码来源:TileService.cs

示例2: EntityManager

 public EntityManager(ITile parent, List<IEntity> entityList)
 {
     this.entityList = entityList ?? new List<IEntity>();
     this.newEntityList = new List<IEntity>();
     this.oldEntityList = new List<IEntity>();
     this.drawEntityList = new List<IDrawableEntity>();
 }
开发者ID:milesgray,项目名称:resatiate,代码行数:7,代码来源:EntityManager.cs

示例3: LavaEntity

        public LavaEntity(ITile tile, Texture2D texture, Color color,
            bool isBlocked, float layerDepth, int damage, IEntity parent,
            IDefendable defender, Vector2 target)
            : base(tile)
        {
            this.destinationRectangle = new Rectangle
            {
                X = tile.Rectangle.Center.X,
                Y = tile.Rectangle.Center.Y,
                Height = texture.Height,
                Width = texture.Width
            };
            this.enabled = true;

            this.isBlocked = isBlocked;
            this.texture = texture;
            this.color = Color.White;
            this.layerDepth = layerDepth;
            this.MoveRate = 5000;
            this.tile = tile;
            this.parent = parent;
            this.Damage = damage;
            this.target = target;
            this.defender = defender;
            this.Position = new Vector2(parent.Rectangle.Center.X, parent.Rectangle.Center.Y);
            this.IsFlying = true;

            this.isTileMovement = false;
        }
开发者ID:milesgray,项目名称:resatiate,代码行数:29,代码来源:LavaEntity.cs

示例4: IsTileTheSame

        public static bool IsTileTheSame(ITile tile1, ITile tile2)
        {
            if (tile1.Active != tile2.Active)
                return false;

            if (tile1.Active)
            {
                if (tile1.Type != tile2.Type)
                    return false;

                if (Main.tileFrameImportant[(int)tile1.Type])
                {
                    if ((tile1.FrameX != tile2.FrameX) || (tile1.FrameY != tile2.FrameY))
                        return false;
                }
            }
            return
                tile1.Wall == tile2.Wall
                &&
                tile1.Liquid == tile2.Liquid
                &&
                tile1.Lava == tile2.Lava
                &&
                tile1.Wire == tile2.Wire;
        }
开发者ID:jason14747,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:25,代码来源:World.cs

示例5: TemplateOveridingDefinitionTile

 public TemplateOveridingDefinitionTile(string name, ITemplate template, ITile extends,
                                    IEnumerable<TileAttribute> attributes)
     : base(name, template, attributes)
 {
     _extends = extends;
     Attributes.MergeTileLazy(_extends);
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:7,代码来源:TemplateOveridingDefinitionTile.cs

示例6: Move

 public override void Move(ITile destination)
 {
     if (!this.CheckMove(destination))
         return;
     this.Mvt--;
     base.Move(destination);
 }
开发者ID:Gweylorth,项目名称:SWOP,代码行数:7,代码来源:Unit.cs

示例7: CheckMove

        /// <summary>
        /// A Gaul can move twice if it crosses a Plain
        /// Cannot cross Water
        /// </summary>
        /// <param name="destination"></param>
        /// <returns></returns>
        public override bool CheckMove(ITile destination)
        {
            if (!destination.IsAdjacent(this.Position) || destination.Type == TileType.Water)
                return false;

            return base.CheckMove(destination); ;
        }
开发者ID:Gweylorth,项目名称:SWOP,代码行数:13,代码来源:Unit.cs

示例8: TowerEntity

        public TowerEntity(ITile location, Texture2D texture, Color color,
            bool isBlocked, float layerDepth, IEntity owner)
            : base(location)
        {
            this.destinationRectangle = new Rectangle
            {
                X = location.Rectangle.X,
                Y = location.Rectangle.Y,
                Height = location.Rectangle.Height,
                Width = location.Rectangle.Width
            };
            this.enabled = true;
            this.isBlocked = true;
            this.texture = texture;
            this.color = color;
            this.layerDepth = layerDepth;

            this.owner = owner;

            this.timer = 5.0f;

            this.IsEnemy = false;
            this.Intensity = 70.0f;
            this.HP = 150;
            this.Damage = 100;
            this.attackRate = 50;
        }
开发者ID:milesgray,项目名称:resatiate,代码行数:27,代码来源:TowerEntity.cs

示例9: HardZombieEntity

        public HardZombieEntity(ITile location, Texture2D texture, Color color,
            bool isBlocked, float layerDepth)
        {
            this.destinationRectangle = new Rectangle
            {
                X = location.Rectangle.X,
                Y = location.Rectangle.Y,
                Height = location.Rectangle.Height,
                Width = location.Rectangle.Width
            };
            this.enabled = true;

            this.isBlocked = isBlocked;
            this.texture = texture;
            this.color = color;
            this.layerDepth = layerDepth;

            this.MoveRate = 100;
            this.Tile = location;

            this.IsEnemy = true;
            this.Intensity = 0.1f;
            this.HP = 10000;
            this.Damage = 200;
            this.attackRate = 200;
            this.moveTask = new MoveTask(this, location);
            this.rand = new Random((int)this.Position.X + DateTime.Now.Second);

            //this.Memory = new Memory_Tile[Tile_Engine.Map.Width, Tile_Engine.Map.Height];

            //this.Map.Add(this.Tile.Clone());

            Tile_Engine.Map.Enemies.Add(this);
        }
开发者ID:milesgray,项目名称:resatiate,代码行数:34,代码来源:HardZombieEntity.cs

示例10: TransferToTile

 public void TransferToTile(ITile next)
 {
     this.currentTile.RemoveEntity(this.entity);
     this.previousTile = this.currentTile;
     this.currentTile = next;
     this.currentTile.AddEntity(this.entity);
 }
开发者ID:milesgray,项目名称:resatiate,代码行数:7,代码来源:tile.Manager.cs

示例11: SpriteEntity

 public SpriteEntity(ITile location, Texture2D texture, Color color,
     bool isBlocked, float layerDepth)
     : base(location)
 {
     this.Rotation = Vector2.Zero.ToRotation();
     this.DrawEnding += _OnDrawEnding;
 }
开发者ID:milesgray,项目名称:resatiate,代码行数:7,代码来源:entity.base.Sprite.cs

示例12: TileManager

        public TileManager(IEntity entity, ITile current)
        {
            this.entity = entity;
            this.currentTile = current;
            this.previousTile = null;

            this.currentTile.AddEntity(this.entity);
        }
开发者ID:milesgray,项目名称:resatiate,代码行数:8,代码来源:tile.Manager.cs

示例13: CanMove

 /// <summary>
 /// Checks if the unit can move during this round to a certain destination.
 /// The destination must be next to the current position,
 /// the unit must have some movement points left,
 /// the tile can't be a sea.
 /// </summary>
 /// <param name="currentPosition">The current position.</param>
 /// <param name="currentTile">The current type of tile.</param>
 /// <param name="destination">The destination to reach.</param>
 /// <param name="tile">The type of tile the destination is.</param>
 /// <returns>True if the unit can move to the destination.</returns>
 public override bool CanMove(IPoint currentPosition, ITile currentTile, IPoint destination, ITile tile, bool occupied)
 {
     return !(tile is ISea)
         && destination.IsNext(currentPosition)
         && (remainingMovementPoints >= MOVEMENT_COST
             // Special case for movement to lowland.
             || ((tile is ILowland) && remainingMovementPoints >= MOVEMENT_COST / 2));
 }
开发者ID:pchaigno,项目名称:smallworld,代码行数:19,代码来源:Gaulois.cs

示例14: AddTile

 public void AddTile(ITile tile)
 {
     if (cache.ContainsKey(tile.Name))
     {
         throw TileException.DoubleDefinition(tile.Name);
     }
     cache.Add(tile.Name, tile);
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:8,代码来源:TilesMap.cs

示例15: Create_ReturnsAUnitWithALocationAndAnOwner

        public void Create_ReturnsAUnitWithALocationAndAnOwner(ITile location, Player owner, ICityFactory<City> factory)
        {
            // :::: ACT ::::
            var city = factory.Create(location, owner);

            // :::: ASSERT ::::
            city.Location.Should().Be(location);
            city.Owner.Should().Be(owner);
        }
开发者ID:SPDiswal,项目名称:ExtenCiv,代码行数:9,代码来源:TestCityFactories.cs


注:本文中的ITile类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。