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


C# TagMap.ContainsKey方法代码示例

本文整理汇总了C#中TagMap.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# TagMap.ContainsKey方法的具体用法?C# TagMap.ContainsKey怎么用?C# TagMap.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TagMap的用法示例。


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

示例1: Portal

        public Portal(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            this.Destination = new ResolvedPortalDestination
            {
                WorldSNO = tags[MarkerKeys.DestinationWorld].Id,
            };

            if (tags.ContainsKey(MarkerKeys.DestinationLevelArea))
                this.Destination.DestLevelAreaSNO = tags[MarkerKeys.DestinationLevelArea].Id;

            if (tags.ContainsKey(MarkerKeys.DestinationActorTag))
                this.Destination.StartingPointActorTag = tags[MarkerKeys.DestinationActorTag];
            else
                Logger.Warn("Found portal {0}without target location actor", this.ActorSNO.Id);

            this.Field2 = 16;

            // FIXME: Hardcoded crap; probably don't need to set most of these. /komiga
            this.Attributes[GameAttribute.MinimapActive] = true;
            this.Attributes[GameAttribute.Hitpoints_Max_Total] = 1f;
            this.Attributes[GameAttribute.Hitpoints_Max] = 0.0009994507f;
            this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f;
            this.Attributes[GameAttribute.Hitpoints_Cur] = 0.0009994507f;
            this.Attributes[GameAttribute.Level] = 1;
        }
开发者ID:wow4all,项目名称:mooege,代码行数:26,代码来源:Portal.cs

示例2: Portal

        public Portal(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            

            try
            {
                this.Destination = new ResolvedPortalDestination
                {
                    WorldSNO = tags[MarkerKeys.DestinationWorld].Id,
                    DestLevelAreaSNO = tags[MarkerKeys.DestinationWorld].Id,
                    StartingPointActorTag = tags[MarkerKeys.DestinationActorTag]
                };

                // Override minimap icon in merkerset tags
                if (tags.ContainsKey(MarkerKeys.MinimapTexture))
                {
                    MinimapIcon = tags[MarkerKeys.MinimapTexture].Id;
                }
                else
                {
                    MinimapIcon = ActorData.TagMap[ActorKeys.MinimapMarker].Id;
                }

            }
            catch (KeyNotFoundException)
            {
                Logger.Warn("Portal {0} has incomplete definition", this.ActorSNO.Id);
            }
            this.Field2 = 16;

            // FIXME: Hardcoded crap; probably don't need to set most of these. /komiga
            //this.Attributes[GameAttribute.MinimapActive] = true;
            //this.Attributes[GameAttribute.Hitpoints_Max_Total] = 1f;
            //this.Attributes[GameAttribute.Hitpoints_Max] = 0.0009994507f;
            //this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f;
            //this.Attributes[GameAttribute.Hitpoints_Cur] = 0.0009994507f;
            //this.Attributes[GameAttribute.Level] = 1;

            // EREKOSE STUFF
            //Logger.Debug(" (Portal ctor) position is {0}", this._position);
            //Logger.Debug(" (Portal ctor) quest range is {0}", this._questRange);
            // Logger.Debug(" (Portal ctor) is in scene SNO {0}", this.CurrentScene.SceneSNO);            
            //Logger.Debug(" (Portal Ctor) portal used has actor SNO {3}, SNO Name {0}, exists in world sno {1}, has dest world sno {2}", this.ActorSNO.Name, tags[MarkerKeys.DestinationWorld].Id, tags[MarkerKeys.DestinationWorld].Id, snoId);

        }
开发者ID:erekos3,项目名称:mooege,代码行数:46,代码来源:Portal.cs

示例3: Portal

        public Portal(World world, int snoId, TagMap tags)
            : base(world, snoId, tags)
        {
            try
            {
                this.Destination = new ResolvedPortalDestination
                {
                    WorldSNO = tags[MarkerKeys.DestinationWorld].Id,
                    DestLevelAreaSNO = tags[MarkerKeys.DestinationLevelArea].Id,
                    StartingPointActorTag = tags[MarkerKeys.DestinationActorTag]
                };

                // Override minimap icon in merkerset tags
                if (tags.ContainsKey(MarkerKeys.MinimapTexture))
                {
                    MinimapIcon = tags[MarkerKeys.MinimapTexture].Id;
                }
                else
                {
                    MinimapIcon = ActorData.TagMap[ActorKeys.MinimapMarker].Id;
                }

            }
            catch (KeyNotFoundException)
            {
                Logger.Warn("Portal {0} has incomplete definition", this.ActorSNO.Id);
            }
            this.Field2 = 16;

            // FIXME: Hardcoded crap; probably don't need to set most of these. /komiga
            //this.Attributes[GameAttribute.MinimapActive] = true;
            //this.Attributes[GameAttribute.Hitpoints_Max_Total] = 1f;
            //this.Attributes[GameAttribute.Hitpoints_Max] = 0.0009994507f;
            //this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f;
            //this.Attributes[GameAttribute.Hitpoints_Cur] = 0.0009994507f;
            //this.Attributes[GameAttribute.Level] = 1;
        }
开发者ID:n3rus,项目名称:mooege,代码行数:37,代码来源:Portal.cs

示例4: Create

        public static Actor Create(World world, int snoId, TagMap tags)
        {
            if (!MPQStorage.Data.Assets[SNOGroup.Actor].ContainsKey(snoId))
                return null;

            var actorAsset = MPQStorage.Data.Assets[SNOGroup.Actor][snoId];
            var actorData = actorAsset.Data as Mooege.Common.MPQ.FileFormats.Actor;
            if (actorData == null) return null;

            if (actorData.Type == ActorType.Invalid)
                return null;

            // see if we have an implementation for actor.
            if (SNOHandlers.ContainsKey(snoId))
                return (Actor)Activator.CreateInstance(SNOHandlers[snoId], new object[] { world, snoId, tags });

            switch (actorData.Type)
            {
                case ActorType.Monster:
                    if (tags.ContainsKey(MarkerKeys.ConversationList))
                        return new InteractiveNPC(world, snoId, tags);
                    else
                        if (!MPQStorage.Data.Assets[SNOGroup.Monster].ContainsKey(actorData.MonsterSNO))
                            return null;

                    var monsterAsset = MPQStorage.Data.Assets[SNOGroup.Monster][actorData.MonsterSNO];
                    var monsterData = monsterAsset.Data as Mooege.Common.MPQ.FileFormats.Monster;
                    if (monsterData.Type == Mooege.Common.MPQ.FileFormats.Monster.MonsterType.Ally ||
                        monsterData.Type == Mooege.Common.MPQ.FileFormats.Monster.MonsterType.Helper)
                        return new NPC(world, snoId, tags);
                    else
                        return new Monster(world, snoId, tags);
                case ActorType.Gizmo:
                    switch (actorData.TagMap[ActorKeys.GizmoGroup])
                    {
                        case GizmoGroup.LootContainer:
                            return new LootContainer(world, snoId, tags);
                        case GizmoGroup.Door:
                            return new Door(world, snoId, tags);
                        case GizmoGroup.DestructibleLootContainer:
                        case GizmoGroup.Barricade:
                            return new DesctructibleLootContainer(world, snoId, tags);
                        case GizmoGroup.Portal:
                            //Prevent Development Hell portal from showing
                            if (tags[MarkerKeys.DestinationWorld].Id != 222591)
                                return new Portal(world, snoId, tags);
                            else
                                return null;
                        case GizmoGroup.BossPortal:
                            Logger.Warn("Skipping loading of boss portals");
                            return null;
                        case GizmoGroup.CheckPoint:
                            return new Checkpoint(world, snoId, tags);
                        case GizmoGroup.Waypoint:
                            return new Waypoint(world, snoId, tags);
                        case GizmoGroup.Savepoint:
                            return new Savepoint(world, snoId, tags);
                        case GizmoGroup.ProximityTriggered:
                            return new ProximityTriggeredGizmo(world, snoId, tags);
                        case GizmoGroup.Shrine:
                            return new Shrine(world, snoId, tags);
                        case GizmoGroup.Healthwell:
                            return new Healthwell(world, snoId, tags);
                        case GizmoGroup.StartLocations:
                            return new StartingPoint(world, snoId, tags);

                        case GizmoGroup.ActChangeTempObject:
                        case GizmoGroup.Banner:
                        case GizmoGroup.CathedralIdol:
                        case GizmoGroup.Destructible:
                        case GizmoGroup.DungeonStonePortal:
                        case GizmoGroup.Headstone:
                        case GizmoGroup.HearthPortal:
                        //case GizmoGroup.NephalemAltar:
                        case GizmoGroup.Passive:
                        case GizmoGroup.PlayerSharedStash:
                        case GizmoGroup.QuestLoot:
                        case GizmoGroup.Readable:
                        case GizmoGroup.ServerProp:
                        case GizmoGroup.Sign:
                        case GizmoGroup.Spawner:
                        case GizmoGroup.TownPortal:
                        case GizmoGroup.Trigger:
                        case GizmoGroup.WeirdGroup57:
                            //Logger.Info("GizmoGroup {0} has no proper implementation, using default gizmo instead", actorData.TagMap[ActorKeys.GizmoGroup]);
                            return CreateGizmo(world, snoId, tags);
                        default:
                            Logger.Warn("Unknown gizmo group {0}", actorData.TagMap[ActorKeys.GizmoGroup]);
                            return CreateGizmo(world, snoId, tags);
                    }
                case ActorType.ServerProp:
                    return new ServerProp(world, snoId, tags);
            }
            return null;
        }
开发者ID:loonbg,项目名称:mooege,代码行数:95,代码来源:ActorFactory.cs

示例5: CreateGizmo

        private static Actor CreateGizmo(World world, int snoId, TagMap tags)
        {
            if (tags.ContainsKey(MarkerKeys.DestinationWorld))
            {
                if (tags[MarkerKeys.DestinationWorld].Id != 222591)
                    return new Portal(world, snoId, tags);
            }

            return new Gizmo(world, snoId, tags);
        }
开发者ID:loonbg,项目名称:mooege,代码行数:10,代码来源:ActorFactory.cs


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