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


C# Commands.Init方法代码示例

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


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

示例1: Init

        /// <summary>
        /// Prepares the command system, registering all base commands.
        /// </summary>
        public void Init(Outputter _output, Client tclient)
        {
            // General Init
            TheClient = tclient;
            CommandSystem = new Commands();
            Output = _output;
            CommandSystem.Output = Output;
            CommandSystem.Init();

            // UI Commands
            CommandSystem.RegisterCommand(new AttackCommand(TheClient));
            CommandSystem.RegisterCommand(new BackwardCommand(TheClient));
            CommandSystem.RegisterCommand(new BindblockCommand(TheClient));
            CommandSystem.RegisterCommand(new BindCommand(TheClient));
            CommandSystem.RegisterCommand(new ForwardCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemdownCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemleftCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemrightCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemupCommand(TheClient));
            CommandSystem.RegisterCommand(new LeftwardCommand(TheClient));
            CommandSystem.RegisterCommand(new MovedownCommand(TheClient));
            CommandSystem.RegisterCommand(new RightwardCommand(TheClient));
            CommandSystem.RegisterCommand(new SecondaryCommand(TheClient));
            CommandSystem.RegisterCommand(new SprintCommand(TheClient));
            CommandSystem.RegisterCommand(new TalkCommand(TheClient));
            CommandSystem.RegisterCommand(new UnbindCommand(TheClient));
            CommandSystem.RegisterCommand(new UpwardCommand(TheClient));
            CommandSystem.RegisterCommand(new UseCommand(TheClient));
            CommandSystem.RegisterCommand(new WalkCommand(TheClient));

            // Common Commands
            CommandSystem.RegisterCommand(new CdevelCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemnextCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemprevCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemselCommand(TheClient));
            CommandSystem.RegisterCommand(new PlayCommand(TheClient));
            CommandSystem.RegisterCommand(new QuickItemCommand(TheClient));
            CommandSystem.RegisterCommand(new QuitCommand(TheClient));
            CommandSystem.RegisterCommand(new ReloadGameCommand(TheClient));

            // Network Commands
            CommandSystem.RegisterCommand(new ConnectCommand(TheClient));
            CommandSystem.RegisterCommand(new DisconnectCommand(TheClient));
            CommandSystem.RegisterCommand(new NetusageCommand(TheClient));
            CommandSystem.RegisterCommand(new PingCommand(TheClient));
            CommandSystem.RegisterCommand(new StartlocalserverCommand(TheClient));

            // Game Commands
            CommandSystem.RegisterCommand(new InventoryCommand(TheClient));
            CommandSystem.RegisterCommand(new TesteffectCommand(TheClient));

            // General Tags
            CommandSystem.TagSystem.Register(new AudioTagBase(TheClient));

            // Entity Tags
            CommandSystem.TagSystem.Register(new PlayerTagBase(TheClient));

            CommandSystem.PostInit();
        }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:62,代码来源:ClientCommands.cs

示例2: Init

        /// <summary>
        /// Prepares the command system, registering all base commands.
        /// </summary>
        public void Init(Outputter _output, Server tserver)
        {
            // General Init
            TheServer = tserver;
            CommandSystem = new Commands();
            Output = _output;
            CommandSystem.Output = Output;
            CommandSystem.Init();

            // Common Commands
            CommandSystem.RegisterCommand(new MeminfoCommand(TheServer));
            CommandSystem.RegisterCommand(new QuitCommand(TheServer));
            CommandSystem.RegisterCommand(new SayCommand(TheServer));

            // File Commands
            CommandSystem.RegisterCommand(new AddpathCommand(TheServer));

            // World Commands
            // ...

            // Item Commands
            CommandSystem.RegisterCommand(new AddrecipeCommand(TheServer));
            CommandSystem.RegisterCommand(new GiveCommand(TheServer));

            // Player Management Commands
            CommandSystem.RegisterCommand(new KickCommand(TheServer));

            // Tag Bases
            CommandSystem.TagSystem.Register(new ArrowEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new BlockGroupEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new BlockItemEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new BulletEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new ColorTagBase());
            CommandSystem.TagSystem.Register(new EntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new GlowstickEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new GrenadeEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new ItemEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new ItemTagBase(TheServer));
            CommandSystem.TagSystem.Register(new LivingEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new LocationTagBase(TheServer));
            CommandSystem.TagSystem.Register(new MaterialTagBase());
            CommandSystem.TagSystem.Register(new ModelEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new PhysicsEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new PlayerTagBase(TheServer));
            CommandSystem.TagSystem.Register(new PrimitiveEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new RecipeResultTagBase(TheServer));
            CommandSystem.TagSystem.Register(new RecipeTagBase(TheServer));
            CommandSystem.TagSystem.Register(new WorldTagBase(TheServer));
            CommandSystem.TagSystem.Register(new ServerTagBase(TheServer));
            CommandSystem.TagSystem.Register(new SmokeGrenadeEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new VehicleEntityTagBase(TheServer));
            CommandSystem.TagSystem.Register(new VehiclePartEntityTagBase(TheServer));

            // Wrap up
            CommandSystem.PostInit();
        }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:59,代码来源:ServerCommands.cs

示例3: UnturnedFreneticCommands

 public UnturnedFreneticCommands(UnturnedFreneticMod mod, UnturnedFreneticOutputter output)
 {
     try
     {
         TheMod = mod;
         System = new Commands();
         output.Syst = System;
         System.Output = output;
         System.Init();
         // Common Commands
         System.RegisterCommand(new AddCommandCommand());
         // Entity Commands
         System.RegisterCommand(new AICommand());
         System.RegisterCommand(new AnimateCommand());
         System.RegisterCommand(new DamageCommand());
         System.RegisterCommand(new HealCommand());
         System.RegisterCommand(new KillCommand());
         System.RegisterCommand(new LaunchCommand());
         System.RegisterCommand(new MaxHealthCommand());
         System.RegisterCommand(new PowerCommand());
         System.RegisterCommand(new RemoveCommand());
         System.RegisterCommand(new SpawnCommand());
         System.RegisterCommand(new TeleportCommand());
         System.RegisterCommand(new WalkCommand());
         // Player Commands
         System.RegisterCommand(new ExperienceCommand());
         System.RegisterCommand(new BleedingCommand());
         System.RegisterCommand(new BrokenCommand());
         System.RegisterCommand(new FoodCommand());
         System.RegisterCommand(new GiveCommand());
         System.RegisterCommand(new OxygenCommand());
         System.RegisterCommand(new StaminaCommand());
         System.RegisterCommand(new TakeCommand());
         System.RegisterCommand(new TellCommand());
         System.RegisterCommand(new UseItemCommand());
         System.RegisterCommand(new VirusCommand());
         System.RegisterCommand(new WarmthCommand());
         System.RegisterCommand(new WaterCommand());
         // World Commands
         System.RegisterCommand(new AnnounceCommand());
         System.RegisterCommand(new EffectCommand());
         System.RegisterCommand(new TimeCommand());
         // Tag Objects
         System.TagSystem.Register(new AnimalAssetTagBase());
         System.TagSystem.Register(new AnimalTagBase());
         System.TagSystem.Register(new BarricadeTagBase());
         System.TagSystem.Register(new ColorTagBase());
         System.TagSystem.Register(new EffectAssetTagBase());
         System.TagSystem.Register(new EntityTagBase());
         System.TagSystem.Register(new ItemAssetTagBase());
         System.TagSystem.Register(new ItemTagBase());
         System.TagSystem.Register(new LocationTagBase());
         System.TagSystem.Register(new OfflinePlayerTagBase());
         System.TagSystem.Register(new PlayerTagBase());
         System.TagSystem.Register(new ResourceAssetTagBase());
         System.TagSystem.Register(new ResourceTagBase());
         System.TagSystem.Register(new ServerTagBase());
         System.TagSystem.Register(new StructureTagBase());
         System.TagSystem.Register(new VehicleAssetTagBase());
         System.TagSystem.Register(new VehicleTagBase());
         System.TagSystem.Register(new WorldObjectAssetTagBase());
         System.TagSystem.Register(new WorldObjectTagBase());
         System.TagSystem.Register(new ZombieTagBase());
         // Events
         UnturnedFreneticEvents.RegisterAll(System);
         // Wrap up
         System.PostInit();
     }
     catch (Exception ex)
     {
         SysConsole.Output(OutputType.ERROR, "Error registering commands: " + ex.ToString());
     }
 }
开发者ID:FreneticXYZ,项目名称:UnturnedFrenetic,代码行数:73,代码来源:UnturnedFreneticCommands.cs


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