當前位置: 首頁>>代碼示例>>C#>>正文


C# Character.removeInnitedAreas方法代碼示例

本文整理匯總了C#中Character.removeInnitedAreas方法的典型用法代碼示例。如果您正苦於以下問題:C# Character.removeInnitedAreas方法的具體用法?C# Character.removeInnitedAreas怎麽用?C# Character.removeInnitedAreas使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Character的用法示例。


在下文中一共展示了Character.removeInnitedAreas方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: sendTo3x3AreaMovement

 public void sendTo3x3AreaMovement(Character character, Area area, byte[] packet)
 {
     if(!this.areaExists(area)) return;
     List<int> relistInnitedAreas = new List<int>();
     for (int i =0; i < 3; i++) {
         for (int u =0; u < 3; u++) {
             Area nearCentral = getArea(new int[] { area.getAreaPosition()[0]-1+i, area.getAreaPosition()[1]-1+u });
             if(nearCentral == null) continue;
             foreach(Character characterAround in nearCentral.getCharacters()) {
                 if(characterAround == character)
                     continue;
                 if(!character.getInnitedAreas().Contains(nearCentral.getaID()))
                 {
                     characterAround.getAccount().mClient.WriteRawPacket(CharacterPackets.extCharPacket(character));
                 }
                 try {
                     Console.WriteLine("AreaMove> Packet sent for {0} from {1}", characterAround.getName(), character.getName());
                     characterAround.getAccount().mClient.WriteRawPacket(packet);
                 }
                 catch(Exception e) {
                     Console.WriteLine(e);
                 }
             }
             if(character.getInnitedAreas().Contains(nearCentral.getaID()))
             {
                 relistInnitedAreas.Add(nearCentral.getaID());
                 continue;
             }
             nearCentral.sendAreaInit(character);
             relistInnitedAreas.Add(nearCentral.getaID());
         }
     }
     character.removeInnitedAreas();
     character.setInnitedAreas(relistInnitedAreas);
 }
開發者ID:cjs3187607,項目名稱:brightmh,代碼行數:35,代碼來源:Grid.cs

示例2: sendTo3x3AreaSpawn

 public void sendTo3x3AreaSpawn(Character character, Area area, Boolean just_a_refresh_for_the_world = false)
 {
     if(!this.areaExists(area)) return;
     character.removeInnitedAreas();
     for (int i =0; i < 3; i++) {
         for (int u =0; u < 3; u++) {
             Area nearCentral = getArea(new int[] { area.getAreaPosition()[0]-1+i, area.getAreaPosition()[1]-1+u });
             if(nearCentral == null) continue;
             if(!just_a_refresh_for_the_world) nearCentral.sendAreaInit(character);
             foreach(Character characterAround in nearCentral.getCharacters()) {
                 if(characterAround == character) continue;
                 try {
                     Console.WriteLine("AreaSpawn> extCharPacket from: {0} for {1}", character.getName(), characterAround.getName());
                     characterAround.getAccount().mClient.WriteRawPacket(CharacterPackets.extCharPacket(character));
                 }
                 catch(Exception e) {
                     Console.WriteLine(e);
                 }
             }
             character.addInnitedArea(nearCentral.getaID());
             WMap.Instance.addToSynchronizedAreas(area);
         }
     }
 }
開發者ID:cjs3187607,項目名稱:brightmh,代碼行數:24,代碼來源:Grid.cs

示例3: sendTo3x3AreaLeave

 public void sendTo3x3AreaLeave(Character character, Area area)
 {
     if(!this.areaExists(area)) return;
     for (int i =0; i < 3; i++) {
         for (int u =0; u < 3; u++) {
             Area nearCentral = getArea(new int[] { area.getAreaPosition()[0]-1+i, area.getAreaPosition()[1]-1+u });
             if(nearCentral == null) continue;
             foreach(Character characterAround in nearCentral.getCharacters()) {
                 if(characterAround == character) continue;
                 try {
                     Console.WriteLine("AreaLeave> vanPacket from: {0} for {1}", character.getName(), characterAround.getName());
                     characterAround.getAccount().mClient.WriteRawPacket(CharacterPackets.vanCharPacket(character));
                 } catch (Exception e) { Console.WriteLine(e); }
             }
         }
     }
     character.getArea().removeCharacter(character);
     character.removeInnitedAreas();
     WMap.Instance.removeFromSynchronizedAreas(area);
 }
開發者ID:cjs3187607,項目名稱:brightmh,代碼行數:20,代碼來源:Grid.cs


注:本文中的Character.removeInnitedAreas方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。