• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IInput类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IInput的典型用法代码示例。如果您正苦于以下问题:C# IInput类的具体用法?C# IInput怎么用?C# IInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IInput类属于命名空间,在下文中一共展示了IInput类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CPlayer

        public CPlayer(IGameObjectManager pObjMan, IEngineCore pEngineCore)
            : base(pObjMan, pEngineCore)
        {
            _fVelocity = 0f;
            uiShotPause = 15;

            ObjType = EGameObjectType.GotPlayer;

            _stPos = new TPoint2(Res.GameVpWidth / 2f, Res.GameVpHeight / 2f);
            _fSize = 150f;
            _fColScale = 0.6f;

            dimPl = new TPoint3(_fSize, _fSize, _fSize);

            IResourceManager pResMan;
            IEngineSubSystem pSubSys;

            pEngineCore.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_INPUT, out pSubSys);
            pInput = (IInput)pSubSys;

            pEngineCore.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_RESOURCE_MANAGER, out pSubSys);
            pResMan = (IResourceManager)pSubSys;

            IEngineBaseObject pBaseObj;
            pResMan.GetResourceByName(Res.MeshShip, out pBaseObj);
            pMesh = (IMesh)pBaseObj;
            pResMan.GetResourceByName(Res.TexShip, out pBaseObj);
            pTex = (ITexture)pBaseObj;
            pResMan.GetResourceByName(Res.TexSpark, out pBaseObj);
            pTexSpark = (ITexture)pBaseObj;
        }
开发者ID:whztt07,项目名称:DGLE,代码行数:31,代码来源:CPlayer.cs


示例2: Console

        public Console(IInput input, IViewer viewer)
        {
            Command = new Command();
            _Filter = LogFilter.All;

            _Initial(input , viewer);
        }
开发者ID:kof1016,项目名称:Regulus,代码行数:7,代码来源:utility_console.cs


示例3: TaskPresenter

 public TaskPresenter(ITaskRepo taskRepo, IInput input, IPrompt prompt, IFileHistoryRepo fileHistoryRepo)
 {
     _taskRepo = taskRepo;
     _input = input;
     _prompt = prompt;
     _fileHistoryRepo = fileHistoryRepo;
 }
开发者ID:fernandozamoraj,项目名称:WindowsToDo,代码行数:7,代码来源:TaskPresenter.cs


示例4: GrammerRuleHandler

 public GrammerRuleHandler(IInput input)
 {
     this.input = input;
     this.identifierMap = new Dictionary<string, object>();
     ContextProvider.GetContext().SetContexts(identifierMap);
     functionsIdentified = 0;
 }
开发者ID:kamatanay,项目名称:MayaLanguage,代码行数:7,代码来源:GrammerRuleHandler.cs


示例5: Console

 public Console(IInput input, IViewer viewer)
 {
     Command = new Command();
     _Filter = LogFilter.All;
     _Commands = new Dictionary<string, string>();
     _Initial(input, viewer);
 }
开发者ID:jiowchern,项目名称:Regulus,代码行数:7,代码来源:Console.cs


示例6: Execute

        /// <summary>
        /// Executes the specified command for the specified connection.
        /// </summary>
        /// <param name="input">The IInput containing the command information to execute.</param>
        /// <param name="connection">The IConnection executing the command.</param>
        public void Execute(IInput input, IConnection connection)
        {
            // Find the command from the input.
            var cmd = FindCommandInternal(input.CommandName);
            if (cmd == null)
            {
                InvalidateResponse(input, connection, CommonResources.CommandInvalidFormat, input.CommandName);
                return;
            }

            string errorMessage;
            if (!cmd.Value.ValidateArguments(input, out errorMessage))
            {
                InvalidateResponse(input, connection, errorMessage);
                return;
            }

            if (cmd.Value.RequiresUser && connection.User == null)
            {
                InvalidateResponse(input, connection, CommonResources.CommandRequiresUser);
                return;
            }

            if (cmd.Value.RequiresCharacter && connection.Character == null)
            {
                InvalidateResponse(input, connection, CommonResources.CommandRequiresCharacter);
                return;
            }

            var response = cmd.Value.Execute(input, connection);
            connection.Write(response);
        }
开发者ID:mobytoby,项目名称:beastmud,代码行数:37,代码来源:CommandManager.cs


示例7: AGSSliderComponent

		public AGSSliderComponent(IGameState state, IInput input, IGameEvents gameEvents)
		{
			_state = state;
			_input = input;
			_gameEvents = gameEvents;
			OnValueChanged = new AGSEvent<SliderValueEventArgs> ();
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:AGSSliderComponent.cs


示例8: Flush

 private void Flush(IInput input)
 {
     if (input != null)
     {
         input.Flush();
     }
 }
开发者ID:gmich,项目名称:GuiSystem,代码行数:7,代码来源:InputManager.cs


示例9: AddInputChannel

        // ------------ Input Channels ------------
        public void AddInputChannel(IInput input)
        {
            if (InputChannels.Contains(input))
                return;

            InputChannels.Add(input);
        }
开发者ID:ValdemarOrn,项目名称:KickBrain,代码行数:8,代码来源:SourceManager.cs


示例10: AGSDraggableComponent

 public AGSDraggableComponent(IInput input, IGameEvents gameEvents)
 {
     _input = input;
     _gameEvents = gameEvents;
     _gameEvents.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute);
     IsDragEnabled = true;
 }
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:AGSDraggableComponent.cs


示例11: Algorithm

        /// <summary>
        /// Constructor (throws ArgumentException on invalid input)
        /// </summary>
        /// <param name="input">input object</param>
        /// <param name="caseSensitive">flag whether find matches with case sensitive or not (default to case insensitive)</param>
        public Algorithm(IInput input, IOverlapCalculator Table, bool caseSensitive = false)
        {
            try
            {
                if (input == null)
                {
                    throw new ArgumentNullException(Errors.InputWasNull);
                }

                if (!input.IsValid)
                {
                    throw new ArgumentException(Errors.InputWasInvalid);
                }

                if (Table == null)
                {
                    throw new ArgumentNullException(Errors.OvelapCalculatorWasNull);
                }

                this.Text = input.Text;
                this.SubText = input.SubText;
                this.PrefixTable = Table.Compute();
                this.IsCaseSensitive = caseSensitive;
            }
            catch (Exception e)
            {
                Logger.Push("Error received while initializing the KMPAlgorithm class object : " + e.Message);
                throw;
            }
        }
开发者ID:alonfai,项目名称:sampleCode,代码行数:35,代码来源:Algorithm.cs


示例12: Cpu

        public Cpu(IMemory memory, IInput input, IOutput output)
        {
            _memory = memory;
            In = input;
            Out = output;
            Registers = new byte[16];

            Commands = new Dictionary<byte, Command>
            {
                {0x01, new IncCommand(this)},
                {0x02, new DecCommand(this)},
                {0x03, new MovCommand(this)},
                {0x04, new MovcCommand(this)},
                {0x05, new LslCommand(this)},
                {0x06, new LsrCommand(this)},
                {0x07, new JmpCommand(this)},
                {0x0A, new JfeCommand(this)},
                {0x0B, new RetCommand(this)},
                {0x0C, new AddCommand(this)},
                {0x0D, new SubCommand(this)},
                {0x0E, new XorCommand(this)},
                {0x0F, new OrCommand(this)},
                {0x10, new InCommand(this)},
                {0x11, new OutCommand(this)}
            };
        }
开发者ID:ramunsk,项目名称:SimpleVM,代码行数:26,代码来源:Cpu.cs


示例13: DebugStateUpdate

 /// <summary>
 /// DebugState update event
 /// </summary>
 /// <param name="input">Input</param>
 /// <param name="deltaTime">Time since the last update</param>
 private static void DebugStateUpdate(IInput input, float deltaTime)
 {
     if (input[Gamepad.Instance.Quit])
     {
         GameEngine.Instance.Quit();
     }
 }
开发者ID:jeffbernard,项目名称:fcbrd,代码行数:12,代码来源:Game.cs


示例14: CreateFakeInput

 private static IInputObservable CreateFakeInput(IInput[] inputEvents)
 {
     var input = A.Fake<IInputObservable>();
     var inputObs = Observable.Interval(TimeSpan.FromSeconds(0.1)).Take(inputEvents.Length).Select(i => inputEvents[i]); // spaces out the input by 1/10 of a second
     A.CallTo(() => input.InputEvents).Returns(inputObs);
     return input;
 }
开发者ID:domisterwoozy,项目名称:LabBox,代码行数:7,代码来源:InputTests.cs


示例15: Update

 public override void Update(GameTime gameTime, IInput input)
 {
     if (input != null)
     {
         if (input.IsKeyDown(Keys.Left) && direction != Direction.Right)
         {
             Direction = Direction.Left;
             return;
         }
         if (input.IsKeyDown(Keys.Right) && direction != Direction.Left)
         {
             Direction = Direction.Right;
             return;
         }
         if (input.IsKeyDown(Keys.Up) && direction != Direction.Bottom)
         {
             Direction = Direction.Top;
             return;
         }
         if (input.IsKeyDown(Keys.Down) && direction != Direction.Top)
         {
             Direction = Direction.Bottom;
             return;
         }
     }
 }
开发者ID:K0bin,项目名称:Snake,代码行数:26,代码来源:SnakeHead.cs


示例16: ExecuteOverride

        protected override void ExecuteOverride(IInput input, IConnection connection, ResponseMessage response)
        {
            User user;
            if (Game.Current.Users.TryGetUser(input, out user))
            {
                // User already exits.
                response.Invalidate(CommonResources.LoginAlreadyExists);
                return;
            }

            // Otherwise, create a user account and add a login.
            user = new User();
            Login login;
            if (!Game.Current.Users.TryCreateLogin(input, out login))
            {
                // User already exits.
                response.Invalidate(CommonResources.LoginAlreadyExists);
                return;
            }

            user.Logins.Add(login);
            Game.Current.Repository.SaveUser(user);
            response.Data = user.Id;
            connection.User = user;
        }
开发者ID:mobytoby,项目名称:beastmud,代码行数:25,代码来源:CreateUserCommand.cs


示例17: TestableInput

 public TestableInput(TestableGameObject obj, IInput input,
                      Sphere sphere)
     : base(obj)
 {
     this.sphere = sphere;
     this.input = input;
 }
开发者ID:ZackGill,项目名称:Uniject,代码行数:7,代码来源:TestableInput.cs


示例18: ExecuteOverride

        protected override void ExecuteOverride(IInput input, IConnection connection, ResponseMessage response)
        {
            if (connection.User == null)
            {
                response.Invalidate(CommonResources.LoginRequired);
                return;
            }

            var username = input.Get<string>("username");
            var login = connection.User.Logins.FirstOrDefault(l => l.UserName.ToLower() == username);
            if (login != null)
            {
                response.Invalidate(CommonResources.LoginAlreadyExists);
                return;
            }

            if (!Game.Current.Users.TryCreateLogin(input, out login))
            {
                response.Invalidate(CommonResources.LoginAlreadyExists);
                return;
            }

            connection.User.Logins.Add(login);
            Game.Current.Repository.SaveUser(connection.User);
        }
开发者ID:mobytoby,项目名称:beastmud,代码行数:25,代码来源:AddLoginCommand.cs


示例19: OnLoginSuccess

        public void OnLoginSuccess(User user, Login login, IInput input)
        {
            var fbLogin = login as FacebookLogin;
            if (fbLogin == null)
                return;

            fbLogin.AccessToken = input.Get<string>("access_token");
        }
开发者ID:mobytoby,项目名称:beastmud,代码行数:8,代码来源:FacebookLoginValidator.cs


示例20: Player

 /// <summary>
 /// Constructor for initialization of plyers.
 /// </summary>
 /// <param name="name">Name of the player.</param>
 /// <param name="field">The player's playfield.</param>
 /// <param name="input">Input object for receiving commands.</param>
 public Player(string name, IField field, IInput input)
 {
     this.Name = name;
     this.Field = field;
     this.input = input;
     this.NumberOfBombs = field.NumberOfBombs;
     this.ShotCount = 0;
 }
开发者ID:kiko81,项目名称:HQC---Battle-Field-4-TeamWork,代码行数:14,代码来源:Player.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IInputArray类代码示例发布时间:2022-05-24
下一篇:
C# IInjector类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap