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


C# IPlayer.RemoveMetadata方法代码示例

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


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

示例1: ForceToZombie

        private void ForceToZombie(IPlayer human)
        {
            human.SetMetadata("forcing", true);
            human.SetMetadata("zombieForcing", true);

            human.SetMetadata("ost.isZombie", true);
            human.SetMetadata("ost.health", (float)100);

            System.Threading.Tasks.Task task = new System.Threading.Tasks.Task(delegate
            {
                double oldX = human.BlockX;
                double oldY = human.BlockY;

                if (this.hologram != null)
                    bot.ChatSayer.Command("/teleport " + human.Name + " " + (int)(hologram.X + 1) + " " + (int)(hologram.Y - 1));

                System.Threading.Thread.Sleep(1000);
                bot.ChatSayer.Command("/kill " + human.Name);
                //bot.ChatSayer.Command("/teleport " + human.Name + " " + oldX + " " + oldY);
                System.Threading.Thread.Sleep(1000);
                bot.ChatSayer.Command("/teleport " + human.Name + " " + oldX + " " + oldY);

                System.Threading.Thread.Sleep(1000);
                human.RemoveMetadata("zombieForcing");
                human.RemoveMetadata("forcing");
            });
            task.Start();
        }
开发者ID:CheeseSoftware,项目名称:MasterBot,代码行数:28,代码来源:Zombies.cs

示例2: EndRecord

 private void EndRecord(IPlayer player)
 {
     List<IEditChange> record = (List<IEditChange>)recordingPlayer.GetMetadata("worldeditrecord");
     if (record.Count > 0)
     {
         if (!player.HasMetadata("worldedithistory"))
             player.SetMetadata("worldedithistory", new List<IEditChange>());
         List<IEditChange> history = (List<IEditChange>)player.GetMetadata("worldedithistory");
         history.Add(new EditChangeList((List<IEditChange>)record));
         if (!player.HasMetadata("worldedithistoryindex"))
             player.SetMetadata("worldedithistoryindex", 0);
         else
             player.SetMetadata("worldedithistoryindex", ((int)player.GetMetadata("worldedithistoryindex")) + 1);
     }
     player.RemoveMetadata("worldeditrecord");
     recordingPlayer = null;
 }
开发者ID:CheeseSoftware,项目名称:MasterBot,代码行数:17,代码来源:WorldEdit.cs

示例3: ForceToNormal

        private void ForceToNormal(IPlayer zombie)
        {
            zombie.SetMetadata("forcing", true);
            zombie.SetMetadata("humanForcing", true);

            zombie.RemoveMetadata("ost.isZombie");
            zombie.RemoveMetadata("ost.zombieCreationTime");
            zombie.SetMetadata("ost.health", (float)100);

            System.Threading.Tasks.Task task = new System.Threading.Tasks.Task(delegate
            {
                double oldX = zombie.X;
                double oldY = zombie.Y;

                if (this.cake != null)
                    bot.ChatSayer.Command("/teleport " + zombie.Name + " " + (int)(cake.X + 1) + " " + (int)(cake.Y - 1));

                System.Threading.Thread.Sleep(500);
                bot.ChatSayer.Command("/kill " + zombie.Name);
                //bot.ChatSayer.Command("/teleport " + zombie.Name + " " + oldX + " " + oldY);
                System.Threading.Thread.Sleep(500);
                bot.ChatSayer.Command("/teleport " + zombie.Name + " " + oldX + " " + oldY);

                System.Threading.Thread.Sleep(1000);
                zombie.RemoveMetadata("humanForcing");
                zombie.RemoveMetadata("forcing");
            });
            task.Start();
        }
开发者ID:CheeseSoftware,项目名称:MasterBot,代码行数:29,代码来源:Zombies.cs


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