public IHttpActionResult PutINPUT_TYPE(int id, INPUT_TYPE iNPUT_TYPE) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != iNPUT_TYPE.INTYPE_ID) { return(BadRequest()); } db.Entry(iNPUT_TYPE).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!INPUT_TYPEExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public void doTest() { INPUT_TYPE inputType = inputMode == 0 ? INPUT_TYPE.BYTE1 : INPUT_TYPE.BYTE4; Builder <T> builder = new Builder <T>(inputType, outputs, 15); foreach (InputOutput <T> pair in pairs) { builder.add(pair.input, pair.output); } FST <T> fst = builder.finish(); if (fst == null) { log.Information("> fst has 0 nodes (fully pruned)"); } else { log.Information("> fst has {nodecount} nodes and {arccount} arcs.", builder.getNodeCount(), builder.getArcCount()); } //TODO: verifyUnPruned(inputMode, fst); nodeCount = builder.getNodeCount(); arcCount = builder.getArcCount(); }
public void Use(Collider2D collider, INPUT_TYPE inputType) { if (!IsOpen) { UpdateBoolState(true); RemotePrefabInstance.StartInteraction(); } }
public static void SetAllInputType(INPUT_TYPE type) { ButtonObjectEvent[] btns = FindObjectsOfType <ButtonObjectEvent>(); foreach (ButtonObjectEvent btn in btns) { btn.inputType = type; } }
public void Use(Collider2D collider, INPUT_TYPE inputType) { if (CollectibleItemObject.IsKeyItem) { throw new UnityException(ErrorConsts.NON_NORMAL_ITEM_ERROR); } Destroy(gameObject); }
public static float GetInput(INPUT_TYPE inputType) { switch (inputType) { case INPUT_TYPE.L1: return(GetButtonL1() ? 1f : 0f); case INPUT_TYPE.L2: return(GetButtonL2()); case INPUT_TYPE.R1: return(GetButtonR1() ? 1f : 0f); case INPUT_TYPE.R2: return(GetButtonR2()); case INPUT_TYPE.SHARE: return(GetButtonShare() ? 1f : 0f); case INPUT_TYPE.CURSOR_RIGHT: return(GetButtonCursorHorizontal() == 1f ? 1f : 0); case INPUT_TYPE.CURSOR_LEFT: return(GetButtonCursorHorizontal() == -1f ? 1f : 0); case INPUT_TYPE.CURSOR_UP: return(GetButtonCursorVertical() == 1f ? 1f: 0); case INPUT_TYPE.CURSOR_DOWN: return(GetButtonCursorVertical() == -1f ? 1f: 0); case INPUT_TYPE.OPTION: return(GetButtonOption() ? 1f : 0f); case INPUT_TYPE.SQURE: return(GetButtonSquare() ? 1f : 0f); case INPUT_TYPE.TRIANGLE: return(GetButtonTriangle() ? 1f : 0f); case INPUT_TYPE.CIRCLE: return(GetButtonCircle() ? 1f : 0f); case INPUT_TYPE.CROSS: return(GetButtonCross() ? 1f : 0f); case INPUT_TYPE.PS: return(GetButtonPS() ? 1f : 0f); case INPUT_TYPE.TRACK_PAD: return(GetButtonTrackPad() ? 1f : 0f); default: return(0f); } }
public FST(INPUT_TYPE inputType, Outputs <T> outputs, int bytesPageBits) { this.inputType = inputType; this.outputs = outputs; this.bytesPageBits = bytesPageBits; this.bytes = new BytesStore(bytesPageBits); // pad: ensure no node gets address 0 which is reserved to mean // the stop state w/ no arcs bytes.writeByte((byte)0); }
public void Use(Collider2D collider, INPUT_TYPE inputType) { IsUnlocked = KeyItemInventory.HasItem(ExpectedObjectInInventory.Id); UpdateBoolState(IsUnlocked); if (IsUnlocked) { RemotePrefabInstance.StartInteraction(); } }
public void AddAlias(string name, string commands, INPUT_TYPE input_type = INPUT_TYPE.PARAMS, string help = null) { // save to shared array (static objects share vars) Core.RegisterNewProperty(name, new Core.CommandProperty { input_type = input_type, help = help, is_alias = true }); Core.aliases[name] = commands; // save new alias Core.core_commands[name] = this; // this is manager :) }
public INPUT(VirtualKey vk, bool key_up) { type = INPUT_TYPE.KEYBOARD; U = new InputUnion(); U.ki = new KEYBDINPUT() { wVk = vk, dwFlags = key_up ? KEYEVENTF.KEYUP : 0 }; }
public IHttpActionResult GetINPUT_TYPE(int id) { INPUT_TYPE iNPUT_TYPE = db.INPUT_TYPE.Find(id); if (iNPUT_TYPE == null) { return(NotFound()); } return(Ok(iNPUT_TYPE)); }
public Builder(INPUT_TYPE inputType, Outputs <T> outputs, int bytesPageBits) { this.fst = new FST <T>(inputType, outputs, bytesPageBits); this.bytes = this.fst.bytes; this.NO_OUTPUT = outputs.getNoOutput(); this.frontier = new UnCompiledNode <T> [10]; for (int i = 0; i < this.frontier.Length; i++) { this.frontier[i] = new UnCompiledNode <T>(this, i); } }
public IHttpActionResult PostINPUT_TYPE(INPUT_TYPE iNPUT_TYPE) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.INPUT_TYPE.Add(iNPUT_TYPE); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = iNPUT_TYPE.INTYPE_ID }, iNPUT_TYPE)); }
void Start() { leftInput = Parameters.Instance.leftInput; rightInput = Parameters.Instance.rightInput; boostDelay = Parameters.Instance.boostDelay; boostStrength = Parameters.Instance.boostStrength; minSpeed = Parameters.Instance.minSpeed; maxSpeed = Parameters.Instance.maxSpeed; accelerationSpeed = Parameters.Instance.accelerationSpeed; brakeSpeed = Parameters.Instance.brakeSpeed; speedScores = Parameters.Instance.speedScores; brakeType = Parameters.Instance.brakeType; }
void SendInput(INPUT_TYPE input_type, Vector3 position) { if (input_type == INPUT_TYPE.CAST) { } else if (input_type == INPUT_TYPE.SUMMON) { m_GameSession.LoadChampion(m_summonPosition); } else if (input_type == INPUT_TYPE.UNSUMMON) { } }
public void Use(Collider2D collider, INPUT_TYPE inputType) { if (!CollectibleItemObject.IsKeyItem) { throw new UnityException(ErrorConsts.NON_KEY_ITEM_ERROR); } UpdateBoolState(true); RemotePrefabInstance.StartInteraction(() => { Destroy(gameObject); }); }
public IHttpActionResult DeleteINPUT_TYPE(int id) { INPUT_TYPE iNPUT_TYPE = db.INPUT_TYPE.Find(id); if (iNPUT_TYPE == null) { return(NotFound()); } db.INPUT_TYPE.Remove(iNPUT_TYPE); db.SaveChanges(); return(Ok(iNPUT_TYPE)); }
public void OnInventory(INPUT_TYPE type) { if (playerInventory.Items.Count == 0) { Debug.Log("There's no inventory items to display yet."); } else { Debug.Log("Trigger an inventory open command and display."); } foreach (ItemMeta itemMeta in playerInventory.Items) { Debug.Log(itemMeta.Name + " x" + itemMeta.Qty); } }
public bool getCotrollerInput(INPUT_TYPE input_type) { switch (input_type) { //バックボタン入力取得 case INPUT_TYPE.BACK_BUTTON: return(OVRInput.Get(OVRInput.RawButton.Back)); //ホームボタン長押し入力取得 case INPUT_TYPE.HOME_BUTTON_LONG_PRESS: return(OVRInput.GetControllerWasRecentered( )); case INPUT_TYPE.TRIGGER: return(OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger)); //トリガー押した時取得 case INPUT_TYPE.TRIGGER_DOWN: return(OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger)); //トリガー話した時取得 case INPUT_TYPE.TRIGGER_UP: return(OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger)); //タッチパッドクリック取得(長押し) case INPUT_TYPE.TOUCH_PAD_CLICK: return(OVRInput.Get(OVRInput.Button.PrimaryTouchpad)); //タッチパッドスクロール上方向取得 case INPUT_TYPE.TOUCH_PAD_SCREEL_UP: return(OVRInput.Get(OVRInput.Button.Up)); //タッチパッドスクロール下方向取得 case INPUT_TYPE.TOUCH_PAD_SCREEL_DOWN: return(OVRInput.Get(OVRInput.Button.Down)); //タッチパッドスクロール左方向取得 case INPUT_TYPE.TOUCH_PAD_SCREEL_LEFT: return(OVRInput.Get(OVRInput.Button.Left)); //タッチパッドスクロール右方向取得 case INPUT_TYPE.TOUCH_PAD_SCREEL_RIGHT: return(OVRInput.Get(OVRInput.Button.Right)); default: return(false); } }
public void Interact(INPUT_TYPE originInputType) { var closestInteractee = GetClosestInteractee(); var interactible = closestInteractee?.GetComponent <IInteractible>(); if (interactible != null) { // Perform related actions on player side (trigger carrying, gaining items, global events, etc) ActionManager.Act(interactible.GetInteractibleType(), interactible.Transform); // Perform related actions on interactible's side (trigger anims, individual data changes, etc) if (!ActionManager.ResponseMustFinish) { interactible.Use(RootCollider, originInputType); } } }
// Main method where the execution begins public static void Main() { try { Console.WriteLine("Do you want to test fixed input or user input? Enter 1 for fixed system input, 2 for user input:"); INPUT_TYPE inputType = (INPUT_TYPE)Convert.ToInt32(Console.ReadLine()); if (inputType != INPUT_TYPE.SYSTEM && inputType != INPUT_TYPE.USER) { throw new Exception("Invalid input! Please enter either 1 or 2."); } List <Product> products = new List <Product>(); if (inputType == INPUT_TYPE.SYSTEM) // System input { Console.WriteLine("Which test case do you want to test? 1, 2, or 3?"); int intTestCase = Convert.ToInt32(Console.ReadLine()); if (intTestCase < 1 || intTestCase > 3) { throw new Exception("Invalid test case! Please enter either 1, 2 or 3."); } products = GetFixedInput(intTestCase); } else // User input { products = GetUserInput(); } if (products.Count <= 0) { throw new Exception("Product list is empty. System is unable to process the orders and generate the invoice."); } ProcessOrders objProcessOrders = new ProcessOrders(products); Invoice objInvoice = objProcessOrders.Process(); objInvoice.Print(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
void Start() { //設定ファイルから入力モードの取得 string mode = ApplicationSetting.Instance.Data["InputMode"].ToLower(); if (mode == "mouse") { inputType = INPUT_TYPE.MOUSE; } else if (mode == "touch") { inputType = INPUT_TYPE.W7TOUCH; } else { inputType = INPUT_TYPE.KINECT; } //初期非表示 fadePlane.gameObject.renderer.enabled = false; }
void Start() { // 設定ファイルから入力モードの取得 string mode = ApplicationSetting.Instance.GetString("InputMode").ToLower(); if (mode == "mouse") { inputType = INPUT_TYPE.MOUSE; } else if (mode == "touch") { inputType = INPUT_TYPE.WTOUCH; } else { inputType = INPUT_TYPE.KINECT; } // 初期非表示 fadePlane.gameObject.GetComponent <Renderer>().enabled = false; }
protected virtual void Start() { //設定ファイルから入力モードの取得 if (ApplicationSetting.Instance.GetString("InputMode").ToLower() == "mouse") { inputType = INPUT_TYPE.MOUSE; } else { inputType = INPUT_TYPE.W7TOUCH; } //自分を描画するカメラを取得 rayCamera = Utils.CameraUtil.FindCameraForLayer(this.gameObject.layer); //ボタンテクスチャの設定 if (guiPlate != null && guiPlate.GetComponent <Renderer>() != null) { defaultButtonColor = guiPlate.GetComponent <Renderer>().material.color; } ChangeTexture(false); }
public bool HasEvent(LZFIGHTERINPUTEVENT fighterEvent, INPUT_TYPE type) { return(inputs.FindIndex((p) => p.type == type && p.ev == fighterEvent) != -1); }
void Update() { transform.position += Vector3.up * currentSpeed * Time.deltaTime; float localAcceleration = accelerationSpeed; INPUT_TYPE inputType = INPUT_TYPE.NONE; bool hasInput = false; Vector2 inputPosition = Vector2.zero; if (Input.touchCount != 0) { hasInput = true; inputPosition = Input.GetTouch(0).position; } else if (Input.GetMouseButton(0)) { hasInput = true; inputPosition = Input.mousePosition; } else if (Input.GetKey(KeyCode.LeftArrow)) { hasInput = true; inputPosition = new Vector2(0, 0); } else if (Input.GetKey(KeyCode.RightArrow)) { hasInput = true; inputPosition = new Vector2(Screen.width, 0); } if (hasInput) { if (inputPosition.x < Screen.width / 2.0f) { inputType = leftInput; } else { inputType = rightInput; } switch (inputType) { case INPUT_TYPE.BOOST: if (boostDelay + lastBoost < Time.time) { currentSpeed += boostStrength; lastBoost = Time.time; } break; case INPUT_TYPE.BRAKE: if (brakeType == BRAKE_TYPE.FLAT) { localAcceleration = -brakeSpeed; } else if (brakeType == BRAKE_TYPE.PROPORTIONNAL) { localAcceleration = -brakeSpeed * currentSpeed; } break; default: break; } } currentSpeed = Mathf.Clamp(currentSpeed + localAcceleration * Time.deltaTime, minSpeed, maxSpeed); Camera.main.orthographicSize = Parameters.Instance.minCamSize + currentSpeed * Parameters.Instance.camScale; speedText.text = string.Format("{0:0.00}", currentSpeed); if (speedScores) { ScoreManager.Instance.score = Mathf.RoundToInt(Mathf.Max(currentSpeed, ScoreManager.Instance.score)); } }
private void AssertExpected(INPUT_TYPE input, OUTPUT_TYPE expected) { OUTPUT_TYPE actual = GetInstance().RenameThis(input); Assert.AreEqual(expected, actual, $"{Environment.NewLine}Expected:\t{expected.ToString()}{Environment.NewLine}Found:\t{actual.ToString()}"); }
public void Use(Collider2D collider, INPUT_TYPE inputType) { MechanismActive = !MechanismActive; UpdateSprite(); UpdateMechanisms(); }
protected virtual void Start() { //設定ファイルから入力モードの取得 if(ApplicationSetting.Instance.GetString("InputMode").ToLower() == "mouse") inputType = INPUT_TYPE.MOUSE; else inputType = INPUT_TYPE.W7TOUCH; //自分を描画するカメラを取得 rayCamera = Utils.CameraUtil.FindCameraForLayer(this.gameObject.layer); //ボタンテクスチャの設定 if(guiPlate != null && guiPlate.renderer != null) defaultButtonColor = guiPlate.renderer.material.color; ChangeTexture(false); }
public abstract void Cancel(INPUT_TYPE type, JoystickManager.JOYSTICK_KEY_STATE keyState, JoystickManager.PLAYER_INDEX player);
public void Use(Collider2D collider, INPUT_TYPE inputType) { // ... }
void Start() { //設定ファイルから入力モードの取得 string mode = ApplicationSetting.Instance.GetString("InputMode").ToLower(); if(mode == "mouse") inputType = INPUT_TYPE.MOUSE; else if(mode == "touch") inputType = INPUT_TYPE.W7TOUCH; else inputType = INPUT_TYPE.KINECT; //初期非表示 fadePlane.gameObject.renderer.enabled = false; }