• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Maps.Map类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: LoadStatics

        public void LoadStatics(TileMatrixData tileData, Map map)
        {
            // get data from the tile Matrix
            byte[] groundData = tileData.GetLandChunk(ChunkX, ChunkY);
            int staticLength;
            byte[] staticsData = tileData.GetStaticChunk(ChunkX, ChunkY, out staticLength);

            // load the ground data into the tiles.
            int groundDataIndex = 0;
            for (int i = 0; i < 64; i++)
            {
                int tileID = groundData[groundDataIndex++] + (groundData[groundDataIndex++] << 8);
                int tileZ = (sbyte)groundData[groundDataIndex++];

                Ground ground = new Ground(tileID, map);
                ground.Position.Set((int)ChunkX * 8 + i % 8, (int)ChunkY * 8 + (i / 8), tileZ);
            }

            // load the statics data into the tiles
            int countStatics = staticLength / 7;
            int staticDataIndex = 0;
            for (int i = 0; i < countStatics; i++)
            {
                int iTileID = staticsData[staticDataIndex++] + (staticsData[staticDataIndex++] << 8);
                int iX = staticsData[staticDataIndex++];
                int iY = staticsData[staticDataIndex++];
                int iTileZ = (sbyte)staticsData[staticDataIndex++];
                int hue = staticsData[staticDataIndex++] + (staticsData[staticDataIndex++] * 256);

                StaticItem item = new StaticItem(iTileID, hue, i, map);
                item.Position.Set((int)ChunkX * 8 + iX, (int)ChunkY * 8 + iY, iTileZ);
            }
        }
开发者ID:jorsi,项目名称:UltimaXNA,代码行数:33,代码来源:MapChunk.cs


示例2: MovingEffect

 public MovingEffect(Map map,int sourceSerial, int targetSerial, int xSource, int ySource, int zSource, int xTarget, int yTarget, int zTarget, int itemID, int hue)
     : this(map, itemID, hue)
 {
     AEntity source = WorldModel.Entities.GetObject<AEntity>(sourceSerial, false);
     if (source != null)
     {
         if (source is Mobile)
         {
             base.SetSource(source.X, source.Y, source.Z);
             Mobile mobile = source as Mobile;
             if ((!mobile.IsClientEntity && !mobile.IsMoving) && ((xSource | ySource | zSource) != 0))
             {
                 source.Position.Set(xSource, ySource, zSource);
             }
         }
         else if (source is Item)
         {
             base.SetSource(source.X, source.Y, source.Z);
             Item item = source as Item;
             if ((xSource | ySource | zSource) != 0)
             {
                 item.Position.Set(xSource, ySource, zSource);
             }
         }
         else
         {
             base.SetSource(xSource, ySource, zSource);
         }
     }
     else
     {
         base.SetSource(xSource, ySource, zSource);
     }
     AEntity target = WorldModel.Entities.GetObject<AEntity>(targetSerial, false);
     if (target != null)
     {
         if (target is Mobile)
         {
             base.SetTarget(target);
             Mobile mobile = target as Mobile;
             if ((!mobile.IsClientEntity && !mobile.IsMoving) && ((xTarget | yTarget | zTarget) != 0))
             {
                 mobile.Position.Set(xTarget, yTarget, zTarget);
             }
         }
         else if (target is Item)
         {
             base.SetTarget(target);
             Item item = target as Item;
             if ((xTarget | yTarget | zTarget) != 0)
             {
                 item.Position.Set(xTarget, yTarget, zTarget);
             }
         }
         else
         {
             base.SetSource(xTarget, yTarget, zTarget);
         }
     }
 }
开发者ID:InjectionDev,项目名称:UltimaXNA,代码行数:60,代码来源:MovingEffect.cs


示例3: Draw

        public override bool Draw(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOverList, Map map)
        {
            if (!m_AllowDefer)
            {
                if (CheckDefer(map, drawPosition))
                    return false;
            }
            else
            {
                m_AllowDefer = false;
            }

            int displayItemdID = (m_Animated) ? Effect.ItemID + ((Effect.FramesActive / m_AnimData.FrameInterval) % m_AnimData.FrameCount) : Effect.ItemID;

            if (displayItemdID != m_DisplayItemID)
            {
                m_DisplayItemID = displayItemdID;
                DrawTexture = IO.ArtData.GetStaticTexture(m_DisplayItemID);
                DrawArea = new Rectangle(DrawTexture.Width / 2 - 22, DrawTexture.Height - World.WorldViews.IsometricRenderer.TileSizeI + (Entity.Z * 4), DrawTexture.Width, DrawTexture.Height);
                PickType = PickType.PickNothing;
                DrawFlip = false;
            }

            // Update hue vector.
            HueVector = Utility.GetHueVector(Entity.Hue);

            return base.Draw(spriteBatch, drawPosition, mouseOverList, map);
        }
开发者ID:gautamabudha,项目名称:UltimaXNA,代码行数:28,代码来源:AnimatedItemEffectView.cs


示例4: Draw

 public override bool Draw(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOver, Map map, bool roofHideFlag)
 {
     if (Entity.NoDraw)
     {
         return false;
     }
     // Update Display texture, if necessary.
     if (Entity.DisplayItemID != m_DisplayItemID)
     {
         m_DisplayItemID = Entity.DisplayItemID;
         DrawTexture = Provider.GetItemTexture(m_DisplayItemID);
         if (DrawTexture == null) // ' no draw ' item.
         {
             return false;
         }
         DrawArea = new Rectangle(DrawTexture.Width / 2 - IsometricRenderer.TILE_SIZE_INTEGER_HALF, DrawTexture.Height - IsometricRenderer.TILE_SIZE_INTEGER + (Entity.Z * 4), DrawTexture.Width, DrawTexture.Height);
         PickType = PickType.PickObjects;
         DrawFlip = false;
     }
     if (DrawTexture == null) // ' no draw ' item.
     {
         return false;
     }
     DrawArea.Y = DrawTexture.Height - IsometricRenderer.TILE_SIZE_INTEGER + (Entity.Z * 4);
     HueVector = Utility.GetHueVector(Entity.Hue, Entity.ItemData.IsPartialHue, false, false);
     if (Entity.Amount > 1 && Entity.ItemData.IsGeneric && Entity.DisplayItemID == Entity.ItemID)
     {
         int offset = Entity.ItemData.Unknown4;
         Vector3 offsetDrawPosition = new Vector3(drawPosition.X - 5, drawPosition.Y - 5, 0);
         base.Draw(spriteBatch, offsetDrawPosition, mouseOver, map, roofHideFlag);
     }
     bool drawn = base.Draw(spriteBatch, drawPosition, mouseOver, map, roofHideFlag);
     DrawOverheads(spriteBatch, drawPosition, mouseOver, map, DrawArea.Y - IsometricRenderer.TILE_SIZE_INTEGER_HALF);
     return drawn;
 }
开发者ID:jorsi,项目名称:UltimaXNA,代码行数:35,代码来源:ItemView.cs


示例5: MovingEffect

 public MovingEffect(Map map,int itemID, int hue)
     : base(map)
 {
     Hue = hue;
     itemID &= 0x3fff;
     m_ItemID = itemID | 0x4000;
 }
开发者ID:msx752,项目名称:UltimaXNA,代码行数:7,代码来源:MovingEffect.cs


示例6: Draw

        public override bool Draw(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOverList, Map map)
        {
            if (!m_AllowDefer)
            {
                if (CheckDefer(map, drawPosition))
                    return false;
            }
            else
            {
                m_AllowDefer = false;
            }

            int displayItemdID = (m_Animated) ? Effect.ItemID + ((Effect.FramesActive / m_AnimData.FrameInterval) % m_AnimData.FrameCount) : Effect.ItemID;

            if (displayItemdID != m_DisplayItemID)
            {
                m_DisplayItemID = displayItemdID;
                IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();
                DrawTexture = provider.GetItemTexture(m_DisplayItemID);
                DrawArea = new Rectangle(DrawTexture.Width / 2 - 22, DrawTexture.Height - IsometricRenderer.TILE_SIZE_INTEGER, DrawTexture.Width, DrawTexture.Height);
                PickType = PickType.PickNothing;
                DrawFlip = false;
            }

            DrawArea.X = 0 - (int)((Entity.Position.X_offset - Entity.Position.Y_offset) * 22);
            DrawArea.Y = 0 + (int)((Entity.Position.Z_offset + Entity.Z) * 4) - (int)((Entity.Position.X_offset + Entity.Position.Y_offset) * 22);

            Rotation = Effect.AngleToTarget;

            // Update hue vector.
            HueVector = Utility.GetHueVector(Entity.Hue);

            return base.Draw(spriteBatch, drawPosition, mouseOverList, map);
        }
开发者ID:InjectionDev,项目名称:UltimaXNA,代码行数:34,代码来源:MovingEffectView.cs


示例7: AnimatedItemEffect

 public AnimatedItemEffect(Map map, int itemID, int hue, int duration)
     : base(map)
 {
     ItemID = (itemID & 0x3fff) | 0x4000;
     Hue = hue;
     Duration = duration;
 }
开发者ID:InjectionDev,项目名称:UltimaXNA,代码行数:7,代码来源:AnimatedItemEffect.cs


示例8: StaticItem

 public StaticItem(int itemID, int hue,  int sortInfluence, Map map)
     : base(Serial.Null, map)
 {
     ItemID = itemID;
     Hue = hue;
     SortInfluence = sortInfluence;
 }
开发者ID:msx752,项目名称:UltimaXNA,代码行数:7,代码来源:StaticItem.cs


示例9: Draw

        public override bool Draw(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOverList, Map map)
        {
            if (!m_AllowDefer)
            {
                if (CheckDefer(map, drawPosition))
                    return false;
            }
            else
            {
                m_AllowDefer = false;
            }

            int displayItemdID = 0x4e20 + Effect.FramesActive;

            if (displayItemdID != m_DisplayItemID)
            {
                m_DisplayItemID = displayItemdID;
                DrawTexture = IO.GumpData.GetGumpXNA(displayItemdID);
                Point offset = m_Offsets[m_DisplayItemID - 20000];
                DrawArea = new Rectangle(offset.X, DrawTexture.Height - 33 + (Entity.Z * 4) + offset.Y, DrawTexture.Width, DrawTexture.Height);
                PickType = PickType.PickNothing;
                DrawFlip = false;
            }

            // Update hue vector.
            HueVector = Utility.GetHueVector(Entity.Hue);

            return base.Draw(spriteBatch, drawPosition, mouseOverList, map);
        }
开发者ID:gautamabudha,项目名称:UltimaXNA,代码行数:29,代码来源:LightningEffectView.cs


示例10: CreateSeasonalTileInfo

        public void CreateSeasonalTileInfo()
        {
            m_StaticCounts = new Dictionary<int, int>();

            TileMatrixData tileData = new TileMatrixData(0);

            Map map = new Map(0);

            for (uint y = 0; y < tileData.ChunkHeight; y++)
            {
                Tracer.Info("Map Parser: row {0}.", y);
                for (uint x = 0; x < tileData.ChunkWidth; x++)
                {
                    ParseMapBlock(tileData, x, y);
                }
            }

            var items = from pair in m_StaticCounts
                        orderby pair.Value descending
                        select pair;

            using (FileStream file = new FileStream(@"AllTiles.txt", FileMode.Create))
            {
                StreamWriter stream = new StreamWriter(file);
                foreach (KeyValuePair<int, int> pair in items)
                {
                    ItemData itemData = TileData.ItemData[pair.Key];
                    if ((itemData.IsBackground || itemData.IsFoliage) && !itemData.IsWet && !itemData.IsSurface)
                        stream.WriteLine(string.Format("{0},{1} ; {2}", pair.Key, pair.Value, itemData.Name));
                }
                stream.Flush();
                file.Flush();
            }
        }
开发者ID:msx752,项目名称:UltimaXNA,代码行数:34,代码来源:MapParser.cs


示例11: BaseBook

 public BaseBook(Serial serial, Map map, bool writable, string title, string author)
     : base(serial, map)
 {
     m_Title = title;
     m_Author = author;
     m_IsEditable = writable;
     m_Pages = new BookPageInfo[0];
 }
开发者ID:jorsi,项目名称:UltimaXNA,代码行数:8,代码来源:BaseBook.cs


示例12: SetMap

 public void SetMap(Map map)
 {
     if (map != Map)
     {
         Map = map;
         Position.Tile = Position3D.NullTile;
     }
 }
开发者ID:msx752,项目名称:UltimaXNA,代码行数:8,代码来源:AEntity.cs


示例13: Render

        public static void Render(SpriteBatch3D spriteBatch, MouseOverList mouseOverList, Map map)
        {
            if (m_Views.Count > 0)
            {
                for (int i = 0; i < m_Views.Count; i++)
                {
                    m_Views[i].View.Draw(spriteBatch, m_Views[i].DrawPosition, mouseOverList, map);
                }

                m_Views.Clear();
            }
        }
开发者ID:HankTheDrunk,项目名称:UltimaXNA,代码行数:12,代码来源:OverheadsView.cs


示例14: Draw

 public override bool Draw(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOverList, Map map)
 {
     if (Entity is Mobile)
     {
         Mobile mobile = Entity as Mobile;
         if (!mobile.IsAlive || mobile.IsDisposed || mobile.Body == 0)
         {
             return false;
         }
     }
     m_BaseView.SetAllowDefer();
     return m_BaseView.Draw(spriteBatch, m_DrawPosition, mouseOverList, map);
 }
开发者ID:HankTheDrunk,项目名称:UltimaXNA,代码行数:13,代码来源:DeferredView.cs


示例15: Draw

        public override bool Draw(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOverList, Map map)
        {
            int facing = MirrorFacingForDraw(Entity.Facing);
            int frameIndex = (int)(Entity.Frame * BodyConverter.DeathAnimationFrameCount(Entity.Body));

            AnimationFrame animationFrame = getFrame(Entity.Body, facing, frameIndex, Entity.Hue);

            DrawTexture = animationFrame.Texture;
            DrawArea = new Rectangle(0, 0, DrawTexture.Width, DrawTexture.Height);
            DrawFlip = false;

            return base.Draw(spriteBatch, drawPosition, mouseOverList, map);
        }
开发者ID:gautamabudha,项目名称:UltimaXNA,代码行数:13,代码来源:CorpseView.cs


示例16: LightningEffect

 public LightningEffect(Map map, int sourceSerial, int xSource, int ySource, int zSource, int hue)
     : this(map, hue)
 {
     AEntity source = WorldModel.Entities.GetObject<AEntity>(sourceSerial, false);
     if (source != null)
     {
         SetSource(source);
     }
     else
     {
         SetSource(xSource, ySource, zSource);
     }
 }
开发者ID:msx752,项目名称:UltimaXNA,代码行数:13,代码来源:LightningEffect.cs


示例17: Mobile

        // ============================================================
        // Ctor, Dispose, Update, and CreateView()
        // ============================================================
        public Mobile(Serial serial, Map map)
            : base(serial, map)
        {
            Equipment = new MobileEquipment(this);
            m_movement = new MobileMovement(this);
            m_movement.RequiresUpdate = true;

            Health = new CurrentMaxValue();
            Stamina = new CurrentMaxValue();
            Mana = new CurrentMaxValue();
            Followers = new CurrentMaxValue();
            Weight = new CurrentMaxValue();
            Flags = new MobileFlags();
        }
开发者ID:HankTheDrunk,项目名称:UltimaXNA,代码行数:17,代码来源:Mobile.cs


示例18: Draw

        public override bool Draw(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOverList, Map map, bool roofHideFlag)
        {
            if (m_NoDraw)
                return false;

            if (m_MustUpdateSurroundings)
            {
                updateSurroundingsAndNormals(Entity.Map);
                m_MustUpdateSurroundings = false;
            }

            if (!m_DrawAs3DStretched)
                return base.Draw(spriteBatch, drawPosition, mouseOverList, map, roofHideFlag);
            else
                return Draw3DStretched(spriteBatch, drawPosition, mouseOverList, map);
        }
开发者ID:msx752,项目名称:UltimaXNA,代码行数:16,代码来源:GroundView.cs


示例19: DrawInternal

 public override bool DrawInternal(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOver, Map map, bool roofHideFlag)
 {
     int displayItemdID = (m_Animated) ? Effect.ItemID + ((Effect.FramesActive / m_AnimData.FrameInterval) % m_AnimData.FrameCount) : Effect.ItemID;
     if (displayItemdID != m_DisplayItemID)
     {
         m_DisplayItemID = displayItemdID;
         DrawTexture = Provider.GetItemTexture(m_DisplayItemID);
         DrawArea = new Rectangle(DrawTexture.Width / 2 - IsometricRenderer.TILE_SIZE_INTEGER_HALF, DrawTexture.Height - IsometricRenderer.TILE_SIZE_INTEGER, DrawTexture.Width, DrawTexture.Height);
         PickType = PickType.PickNothing;
         DrawFlip = false;
     }
     DrawArea.X = 0 - (int)((Entity.Position.X_offset - Entity.Position.Y_offset) * IsometricRenderer.TILE_SIZE_INTEGER_HALF);
     DrawArea.Y = 0 + (int)((Entity.Position.Z_offset + Entity.Z) * 4) - (int)((Entity.Position.X_offset + Entity.Position.Y_offset) * IsometricRenderer.TILE_SIZE_INTEGER_HALF);
     Rotation = Effect.AngleToTarget;
     HueVector = Utility.GetHueVector(Entity.Hue);
     return base.Draw(spriteBatch, drawPosition, mouseOver, map, roofHideFlag);
 }
开发者ID:jorsi,项目名称:UltimaXNA,代码行数:17,代码来源:MovingEffectView.cs


示例20: DrawInternal

        public override bool DrawInternal(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOverList, Map map, bool roofHideFlag)
        {
            int facing = MirrorFacingForDraw(Entity.Facing);
            int frameIndex = (int)(Entity.Frame * BodyConverter.DeathAnimationFrameCount(Entity.Body));

            IAnimationFrame animationFrame = getFrame(Entity.Body, facing, frameIndex, Entity.Hue);

            DrawFlip = (MirrorFacingForDraw(Entity.Facing) > 4) ? true : false;

            DrawTexture = animationFrame.Texture;

            DrawArea = new Rectangle(
                animationFrame.Center.X - IsometricRenderer.TILE_SIZE_INTEGER_HALF,
                DrawTexture.Height - IsometricRenderer.TILE_SIZE_INTEGER_HALF + (Entity.Z * 4) + animationFrame.Center.Y, DrawTexture.Width, DrawTexture.Height);

            return base.Draw(spriteBatch, drawPosition, mouseOverList, map, roofHideFlag);
        }
开发者ID:leventcorapsiz,项目名称:UltimaXNA,代码行数:17,代码来源:CorpseView.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Core.ApplicationContext类代码示例发布时间:2022-05-26
下一篇:
C# UI.AControl类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap