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


C# AccountUC.ActualizeMap方法代码示例

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


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

示例1: MapComplementaryInformationsDataMessageTreatment

        public static void MapComplementaryInformationsDataMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            MapComplementaryInformationsDataMessage msg = (MapComplementaryInformationsDataMessage)message;
            account.HeroicUC.AnalysePacket(message, packetDatas);
            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            if (account.petsList.Count != 0 && account.checkBoxBegin.Checked == true)
            {
                account.StartFeeding();
            }
            else if (account.checkBoxBegin.Checked == true)
            {
                account.Log(new ErrorTextInformation("Aucun familier dans l'inventaire."),0);
                account.checkBoxBegin.Checked = false;
            }
            if (account.Map.Data != null)
                account.Map.LastMapId = account.Map.Id;
            account.Map.SubAreaId = msg.subAreaId;
            account.Map.Data = MapsManager.FromId(msg.mapId);
            account.Enable(true);
            DataClass subArea = GameData.GetDataObject(D2oFileEnum.SubAreas, (int)msg.subAreaId);
            string mapName = I18N.GetText((int)GameData.GetDataObject(D2oFileEnum.Areas, (int)subArea.Fields["areaId"]).Fields["nameId"]);
            string subAreaName = I18N.GetText((int)subArea.Fields["nameId"]);
            account.ModifBar(5, 0, 0, "[" + account.Map.X + ";" + account.Map.Y + "]" + " " + mapName + " (" + subAreaName + ")");
            account.Map.Entities.Clear();
            account.Map.List.Clear();
            foreach (GameRolePlayActorInformations actor in msg.actors)
            {
                account.Map.Entities.Add(new BlueSheep.Core.Fight.Entity(actor.contextualId, actor.disposition.cellId));
                if (actor is GameRolePlayGroupMonsterInformations)
                {
                    GameRolePlayGroupMonsterInformations a = (GameRolePlayGroupMonsterInformations)actor;
                    account.Map.List.Add(new MonsterGroup(a.staticInfos, a.disposition.cellId, a.contextualId));
                }

            }
            account.Map.StatedElements.Clear();
            foreach (var statedElementDofus in msg.statedElements)
            {
                if (!(account.Map.StatedElements.ContainsKey(statedElementDofus.elementId)))
                    account.Map.StatedElements.Add(statedElementDofus.elementId, new BlueSheep.Core.Map.Elements.StatedElement((uint)statedElementDofus.elementCellId, (uint)statedElementDofus.elementId, (uint)statedElementDofus.elementState));
            }
            account.Map.InteractiveElements.Clear();
            account.Map.Doors.Clear();
            foreach (var element in msg.interactiveElements)
            {
                account.Map.InteractiveElements.Add(element.elementId, new BlueSheep.Core.Map.Elements.InteractiveElement((uint)element.elementId, element.elementTypeId, new List<InteractiveElementSkill>(element.enabledSkills), new List<InteractiveElementSkill>(element.disabledSkills)));
                InteractiveElement interactiveElement = element;
                List<int> listDoorSkillId = new List<int>(new[] { 184, 183, 187, 198, 114 });
                List<int> listDoorTypeId = new List<int>(new[] { -1, 128, 168, 16 });
                if (listDoorTypeId.Contains(interactiveElement.elementTypeId) && (interactiveElement.enabledSkills.Length > 0) && (listDoorSkillId.Contains(interactiveElement.enabledSkills[0].skillId)))
                {
                    foreach (var layer in ((BlueSheep.Data.D2p.Map)account.Map.Data).Layers)
                    {
                        foreach (var cell in layer.Cells)
                        {
                            foreach (var layerElement in cell.Elements)
                            {
                                if (layerElement is GraphicalElement)
                                {
                                    GraphicalElement graphicalElement = (GraphicalElement)layerElement;
                                    if ((graphicalElement.Identifier == interactiveElement.elementId) && !(account.Map.Doors.ContainsKey(cell.CellId)))
                                        account.Map.Doors.Add(cell.CellId, new BlueSheep.Core.Map.Elements.InteractiveElement((uint)element.elementId, element.elementTypeId, new List<InteractiveElementSkill>(element.enabledSkills), new List<InteractiveElementSkill>(element.disabledSkills)));
                                }
                            }
                        }
                    }
                }
            }
            account.Npc.Npcs.Clear();
            foreach (GameRolePlayActorInformations a in msg.actors)
            {
                if (a is GameRolePlayNpcInformations)
                    account.Npc.Npcs.Add(a.contextualId, ((GameRolePlayNpcInformations)a).npcId);
            }
            if (account.Path != null)
            {
                if (account.Path.Current_Flag == "<Fight>" && (account.StatusLb.Text != "Combat" || account.StatusLb.Text == "Fighting") && account.Path.Current_Map == account.Map.X.ToString() + "," + account.Map.Y.ToString())
                {
                    if (account.Fight.SearchFight() == false)
                    {
                        account.Path.PerformActionsStack();
                    }
                }
                else if (account.StatusLb.Text != "Combat" && account.StatusLb.Text != "Fighting" && account.Path.Current_Map == account.Map.X.ToString() + "," + account.Map.Y.ToString() && account.Map.LastMapId == account.Map.Id)
                    account.Path.PerformActionsStack();
                else if ((account.Path.Current_Map != account.Map.X.ToString() + "," + account.Map.Y.ToString()) || account.Map.Id != account.Map.LastMapId)
                {
                    account.Path.Stop = false;
                    account.Path.ParsePath();
                }
            }
            account.ActualizeMap();
            account.Map.LastMapId = account.Map.Id;
        }
开发者ID:DjTrilogic,项目名称:BlueSheep,代码行数:97,代码来源:ContextHandler.cs

示例2: MapComplementaryInformationsDataMessageTreatment

 public static void MapComplementaryInformationsDataMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
 {
     MapComplementaryInformationsDataMessage msg = (MapComplementaryInformationsDataMessage)message;
     account.HeroicUC.AnalysePacket(message, packetDatas);
     using (BigEndianReader reader = new BigEndianReader(packetDatas))
     {
         msg.Deserialize(reader);
     }
     account.Gather.ClearError();
     account.MapData.Clear();
     account.MapData.ParseLocation(msg.mapId, msg.subAreaId);
     account.MapData.ParseStatedElements(msg.statedElements);
     account.MapData.ParseActors(msg.actors);
     account.MapData.ParseInteractiveElements(msg.interactiveElements);
     account.Enable(true);
     account.MapData.DoAction();
     account.ActualizeMap();
 }
开发者ID:Sadikk,项目名称:BlueSheep,代码行数:18,代码来源:ContextHandler.cs


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