// Use this for initialization void Start() { m_Input = GetComponent<BaseInput>(); m_ObjectPool = FindObjectOfType<ObjectPool>(); m_ScreenShakeManager = FindObjectOfType<ScreenShakeManager>(); }
protected override void InputHandling() { mInput = new BaseInput(); InputColorChange(); InputMovement(); InputShoot(); }
public void Init() { baseInput = new BaseInput(); gesturesRecognizer = new GesturesRecognizer(baseInput); gesturesRecognizer.Init(); gesturesRecognizer.OnStartPinch+=this.OnPinchStart; gesturesRecognizer.OnPinch+=this.OnPinch; gesturesRecognizer.OnTap+=this.OnTap; gesturesRecognizer.OnSwipeStart+=this.OnSwipeStarted; gesturesRecognizer.OnSwipe+=this.OnSwipe; gesturesRecognizer.OnSwipeStoped+=this.OnSwipeStoped; Singlton.world.OnLateInit+= this.OnLateInit; }
public static int GetMouseButtonUp(IntPtr l) { int result; try { BaseInput baseInput = (BaseInput)LuaObject.checkSelf(l); int button; LuaObject.checkType(l, 2, out button); bool mouseButtonUp = baseInput.GetMouseButtonUp(button); LuaObject.pushValue(l, true); LuaObject.pushValue(l, mouseButtonUp); result = 2; } catch (Exception e) { result = LuaObject.error(l, e); } return result; }
public static int GetButtonDown(IntPtr l) { int result; try { BaseInput baseInput = (BaseInput)LuaObject.checkSelf(l); string buttonName; LuaObject.checkType(l, 2, out buttonName); bool buttonDown = baseInput.GetButtonDown(buttonName); LuaObject.pushValue(l, true); LuaObject.pushValue(l, buttonDown); result = 2; } catch (Exception e) { result = LuaObject.error(l, e); } return result; }
void InsideMenu(object obj) { InsideType temp = (InsideType)obj; switch (temp) { case InsideType.Remove: MouseAtThisWindow_1.Delected(); windowsNode.Remove(MouseAtThisWindow_1); MouseAtThisWindow_1 = null; break; case InsideType.Make_Link: IsPickingNodeInterface = true; break; case InsideType.Smart_Link: IsPickingNodeInterface = true; //------------ break; } }
public static int GetTouch(IntPtr l) { int result; try { BaseInput baseInput = (BaseInput)LuaObject.checkSelf(l); int index; LuaObject.checkType(l, 2, out index); Touch touch = baseInput.GetTouch(index); LuaObject.pushValue(l, true); LuaObject.pushValue(l, touch); result = 2; } catch (Exception e) { result = LuaObject.error(l, e); } return result; }
public static int GetAxisRaw(IntPtr l) { int result; try { BaseInput baseInput = (BaseInput)LuaObject.checkSelf(l); string axisName; LuaObject.checkType(l, 2, out axisName); float axisRaw = baseInput.GetAxisRaw(axisName); LuaObject.pushValue(l, true); LuaObject.pushValue(l, axisRaw); result = 2; } catch (Exception e) { result = LuaObject.error(l, e); } return result; }
public async Task <IActionResult> SignObservationForm([FromBody] BaseInput input) { var entity = await _waterMObservationApp.GetForm(input.KeyValue); if (entity == null) { return(Error("未找到记录")); } if (entity.F_CheckPerson != null) { return(Error("记录已核对签名!")); } var user = await _usersService.GetCurrentUserAsync(); entity.F_CheckPerson = user.F_Id; entity.F_CheckPersonName = user.F_RealName; await _waterMObservationApp.UpdateForm(entity); return(Success("操作成功。")); }
/* * EvalAdvance * * fuzzy function used to determine if the group advancement function should be used * * @param BaseInput inp - the input of the fuzzy logic machine * @returns float - the score evaluated */ public float EvalAdvance(BaseInput inp) { //up-cast the base input ManagerInput minp = inp as ManagerInput; //count the visible and total enemies of the opponents int visibleEnemies = 0; int totalEnemies = 0; //get the size of the players array int playerSize = minp.manager.players.Count; //iterate through all players except for this one, getting the amount of enemies that are visible and the total for (int i = 0; i < playerSize; i++) { //store in a temp variable BasePlayer bp = minp.manager.players[i]; //check for the same team if (bp.playerID == playerID) { continue; } //get the size of the player's units array int unitCount = bp.units.Count; totalEnemies += unitCount; //check for visibility and count for (int j = 0; j < unitCount; j++) { if (bp.units[j].inSight) { visibleEnemies++; } } } return(((1 - (float)visibleEnemies / (float)totalEnemies)) * advanceImportance); }
private static Stream CreateStream(BaseInput input, string inputPath, int?position, CodecConfig codecConfig, SelectionMode selectionMode) { var inputStream = new InputStream { InputId = input.Id, InputPath = inputPath, Position = position, SelectionMode = selectionMode }; var stream = new Stream { InputStreams = new List <InputStream> { inputStream }, CodecConfigId = codecConfig.Id }; return(stream); }
public IActionResult DeleteConclusionTemplate([FromBody] BaseInput input) { //var user = LoginInfoHelper.GetCurrentLoginUser(); //var conclusionTemplateApp = new ConclusionTemplateApp(); //var entity = new ConclusionTemplateEntity //{ // F_Id = Common.GuId(), // F_EnabledMark = true, // F_CreatorTime = DateTime.Now, // F_CreatorUserId = user.F_Id, // F_Title = input.title, // F_Content = input.content, // F_IsPrivate = input.isPrivate //}; _conclusionTemplateApp.DeleteForm(input.KeyValue); //var data = new //{ // id = entity.F_Id //}; return(Ok("删除成功")); }
/// <summary> /// 根据代码、名称、拼音查询药品简要信息 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <IActionResult> GetList([FromQuery] BaseInput input) { var data = (from r in await _drugsApp.GetList(input == null ? "" : input.KeyValue) select new { id = r.F_Id, code = r.F_DrugCode, name = r.F_DrugName, spec = r.F_DrugSpec, unit = r.F_DrugUnit, miniAmount = r.F_DrugMiniAmount, miniPackage = r.F_DrugMiniPackage, miniSpec = r.F_DrugMiniSpec, administration = r.F_DrugAdministration, spell = r.F_DrugSpell, supplier = r.F_DrugSupplier, price = r.F_Charges }).ToList(); return(Ok(data)); }
public async Task <IActionResult> Sign([FromBody] BaseInput input) { var entity = await _waterMDisinfectApp.GetForm(input.KeyValue); if (entity == null) { return(BadRequest("主键有误")); } if (!string.IsNullOrEmpty(entity.F_CheckPerson)) { return(BadRequest("记录已签名")); } var userId = _usersService.GetCurrentUserId(); entity.F_LastModifyTime = DateTime.Now; entity.F_LastModifyUserId = userId; entity.F_CheckPerson = userId; await _waterMDisinfectApp.UpdateForm(entity); return(Ok("操作成功")); }
/// <summary> /// 今日就诊-治疗单详情-穿刺历史记录 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <IActionResult> GetHistoryList(BaseInput input) { var output = new GetHistoryListOutput(); var filePath = Path.Combine(AppConsts.AppRootPath, "upload", "Puncture", input.KeyValue); if (FileHelper.IsExistDirectory(filePath)) { output.imagePath = FileHelper.GetFileNamesWithoutPath(filePath).OrderBy(t => t).LastOrDefault(); } var list = await _punctureApp.GetList(input.KeyValue, 30); var table = new Hashtable(); foreach (var item in list) { if (!string.IsNullOrEmpty(item.F_Nurse)) { if (!table.ContainsKey(item.F_Nurse)) { var find = await _usersService.FindUserAsync(item.F_Nurse); table.Add(item.F_Nurse, find?.F_RealName ?? ""); } } var puncture = new PunctureItem { id = item.F_Id, point1 = item.F_Point1, point2 = item.F_Point1, memo = item.F_Memo, operateTime = item.F_OperateTime, isSucess = item.F_IsSuccess ?? true, nurseId = item.F_Nurse, nurseName = string.IsNullOrEmpty(item.F_Nurse) ? "" : table[item.F_Nurse].ToString() }; output.punctureItems.Add(puncture); } return(Ok(output)); }
public async Task <IActionResult> GetForm(BaseInput input) { var entity = await _infectionApp.GetForm(input.KeyValue); var data = new { id = entity.F_Id, reportDate = entity.F_ReportDate, item1 = entity.F_Item1.ToFloat(2), item2 = entity.F_Item2.ToFloat(2), item3 = entity.F_Item3.ToFloat(2), item4 = entity.F_Item4.ToFloat(2), item5 = entity.F_Item5.ToFloat(2), item6 = entity.F_Item6.ToFloat(2), item7 = entity.F_Item7.ToFloat(2), recordPerson = entity.F_RecordPerson == null ? "" : (await _usersService.FindUserAsync(entity.F_RecordPerson))?.F_RealName, imangePath = entity.F_ImangePath, memo = entity.F_Memo }; return(Ok(data)); }
/// <summary> /// 查找单一药品 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <IActionResult> GetForm([FromQuery] BaseInput input) { var r = await _drugsApp.GetForm(input.KeyValue); var data = new { id = r.F_Id, code = r.F_DrugCode, name = r.F_DrugName, spec = r.F_DrugSpec, unit = r.F_DrugUnit, miniAmount = r.F_DrugMiniAmount, miniPackage = r.F_DrugMiniPackage, miniSpec = r.F_DrugMiniSpec, administration = r.F_DrugAdministration, spell = r.F_DrugSpell, supplier = r.F_DrugSupplier, price = r.F_Charges }; return(Ok(data)); }
public async Task <IActionResult> SignForm([FromBody] BaseInput input) { var entity = await _machineDisinfectionApp.GetForm(input.KeyValue); if (entity == null) { return(Error("未找到记录")); } if (entity.F_OperatePerson == null) { return(Error("请先填写记录!")); } if (entity.F_CheckPerson != null) { return(Error("记录已签名,请核对!")); } entity.F_CheckPerson = _usersService.GetCurrentUserId(); await _machineDisinfectionApp.UpdateForm(entity); return(Success("操作成功。")); }
void AddWindow(object obj) { BaseInput temp = null; NodeType node = (NodeType)obj; switch (node) { case NodeType.RenderNode: temp = ScriptableObject.CreateInstance<RenderNode>(); break; case NodeType.ShapeNode: temp = ScriptableObject.CreateInstance<ShapeNode>(); break; case NodeType.MorphNode: temp = ScriptableObject.CreateInstance<MorphNode>(); break; case NodeType.Result: temp = ScriptableObject.CreateInstance<ResultGroupNode>(); break; } temp.windowRect.position = mousePos; windowsNode.Add(temp); }
public async Task <IActionResult> DeleteForm([FromBody] BaseInput input) { var entity = await _ordersApp.GetForm(input.KeyValue); if (entity != null) { entity.F_DeleteMark = true; entity.F_EnabledMark = false; await _ordersApp.UpdateForm(entity); var childrens = await _ordersApp.GetChildrens(input.KeyValue); foreach (var item in childrens) { item.F_DeleteMark = true; item.F_EnabledMark = false; await _ordersApp.UpdateForm(item); } return(Success("删除成功。")); } return(Error("医嘱ID有误。")); }
private void Start() { mPolarSystemTransform = GetComponent <PolarSystemTransform>(); switch (currentType) { default: case ControlType.Mouse: mInput = new MouseInput(); break; case ControlType.Touch: mInput = new MobileTouchInput(); break; } if (null != mInput && currentType != ControlType.None) { mInput.OnMoveEvent += OnMove; mInput.OnRotateEvent += OnRotate; } }
public static Canvas CreateCanvas() { // Create a Canvas GameObject with all it's components GameObject newCanvas = new GameObject { name = "Canvas" }; Canvas canvasComponent = newCanvas.AddComponent <Canvas>(); CanvasScaler canvasScalerComponent = newCanvas.AddComponent <CanvasScaler>(); GraphicRaycaster graphicRaycasterComponent = newCanvas.AddComponent <GraphicRaycaster>(); // Then create an EventSystem GameObject and it's components GameObject newEventSystem = new GameObject { name = "EventSystem" }; EventSystem eventSystemComponent = newEventSystem.AddComponent <EventSystem>(); StandaloneInputModule standaloneInputModuleComponent = newEventSystem.AddComponent <StandaloneInputModule>(); BaseInput baseInputComponent = newEventSystem.AddComponent <BaseInput>(); // Then set up the components canvasComponent.renderMode = RenderMode.ScreenSpaceOverlay; return(canvasComponent); }
public BaseInput <bool> Login(InputClass _user) { BaseInput <bool> _output = new BaseInput <bool>(); AppUser _newuser = GetUserByString(_user.Username); if (_newuser == null) { _output.Status = "@UserNotFound"; return(_output); } if (_newuser.Password == _user.Password) { _output.Status = "@SuccessfulLogin"; } else { _output.Status = "@WrongPassword"; } _output.Output = true; return(_output); }
public async Task <IActionResult> StopOrder([FromBody] BaseInput input) { var orderStopTime = System.DateTime.Now; var entity = await _ordersApp.GetForm(input.KeyValue); if (entity != null) { entity.F_OrderStopTime = orderStopTime; entity.F_OrderStatus = 3; await _ordersApp.UpdateForm(entity); var childrens = await _ordersApp.GetChildrens(input.KeyValue); foreach (var item in childrens) { item.F_OrderStopTime = orderStopTime; item.F_OrderStatus = 3; await _ordersApp.UpdateForm(item); } return(Success("停用成功。")); } return(Error("医嘱ID有误。")); }
public async Task <BaseInput <bool> > Register(InputClass _user) { BaseInput <bool> _output = new BaseInput <bool>(); if (GetUserByString(_user.Username) != null) { _output.Status = "@UsernameTaken"; } _context.Users.Add( new AppUser { Username = _user.Username, Password = _user.Password, Points = 100, MatchHistory = null }); await _context.SaveChangesAsync(); _output.Status = "@SuccessfulRegister"; _output.Output = true; return(_output); }
/// <summary> /// 刷新医生医嘱 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <IActionResult> GetDoctorOrders(BaseInput input) { var entity = await _patVisitApp.GetForm(input.KeyValue); //OrdersApp ordersApp = new OrdersApp(); var orders = (await _ordersApp.GetList(entity.F_Pid, entity.F_VisitDate.ToDate(), entity.F_VisitDate.ToDate().AddDays(1), true)) .Where(t => t.F_OrderType.Equals("药疗")).OrderBy(t => t.F_IsTemporary); //医生医嘱 var data = orders.Select(t => new { id = t.F_Id, isTemporary = t.F_IsTemporary, orderText = t.F_OrderText, orderUnitSpec = t.F_OrderUnitSpec, orderAmount = t.F_OrderAmount, orderFrequency = t.F_OrderFrequency, orderAdministration = t.F_OrderAdministration, orderStatus = t.F_OrderStatus }); return(Ok(data)); }
/* * EvalEffort * * fuzzy function used to determine if the unit should give up * * @param BaseInput inp - the object containing useful data that the function uses to determine what to do * @returns void */ public float EvalEffort(BaseInput inp) { //up-cast the base input ManagerInput minp = inp as ManagerInput; //don't even consider attacking if the unit is a medic if (minp.unit is Medic) { return(0.0f); } //count the total enemies of the opponents int totalEnemies = 0; //get the size of the players array int playerSize = minp.manager.players.Count; //iterate through all players except for this one, getting the amount of enemies that are visible and the total for (int i = 0; i < playerSize; i++) { //store in a temp variable BasePlayer bp = minp.manager.players[i]; if (bp.playerID == playerID) { continue; } //get the size of the player's units array int unitCount = bp.units.Count; totalEnemies += unitCount; } return((1 - ((float)units.Count / (float)totalEnemies)) * effortImportance); }
public async Task <IActionResult> SaveToNextWeek([FromBody] BaseInput input) { if (DateTime.TryParse(input.KeyValue, out var startDate)) { var currentDate = DateTime.Now.Date; //下周周一时间 var monday = currentDate.DayOfWeek == DayOfWeek.Sunday ? currentDate.AddDays(1) : currentDate.DayOfWeek == DayOfWeek.Monday ? currentDate.AddDays(7) : currentDate.DayOfWeek == DayOfWeek.Tuesday ? currentDate.AddDays(6) : currentDate.DayOfWeek == DayOfWeek.Wednesday ? currentDate.AddDays(5) : currentDate.DayOfWeek == DayOfWeek.Thursday ? currentDate.AddDays(4) : currentDate.DayOfWeek == DayOfWeek.Friday ? currentDate.AddDays(3) : currentDate.DayOfWeek == DayOfWeek.Saturday ? currentDate.AddDays(2) : currentDate; if (startDate >= monday) { return(Error("数据源日期【" + startDate.ToDateString() + "】不能大于" + monday.ToDateString())); } var nextlist = _dialysisScheduleApp.GetList(monday, monday.AddDays(6)).ToList(); var interval = (monday - startDate).TotalDays.ToInt(); if (interval <= 0) { return(Error("起始日期错误,不能是本周一!")); } ////按照床号 患者ID 过滤 患者停用 床停用等 //var list = from d in _dialysisScheduleApp.GetList(startDate, startDate.AddDays(6)).FindAll(c => c.F_PId != null) // join m in machineApp.GetList() on d.F_BId equals m.F_Id // join p in patientApp.GetList() on d.F_PId equals p.F_Id // select d; await _dialysisScheduleApp.CreateItems((_dialysisScheduleApp.GetList(startDate, startDate.AddDays(6)).ToList()).FindAll(c => c.F_PId != null), nextlist, interval); } else { return(Error("起始日期错误")); } return(Success("操作成功。")); }
public async Task <IActionResult> DeleteForm([FromBody] BaseInput input) { await _moduleApp.DeleteForm(input.KeyValue); return(Success("删除成功。")); }
public async Task <IActionResult> DeleteObservationForm([FromBody] BaseInput input) { await _waterMObservationApp.DeleteForm(input.KeyValue); return(Success("删除成功。")); }
private Dictionary <string, BaseInput> InitializeInputs(EventQueue queue) { F2BSection config = F2B.Config.Instance; InputCollection inputs = config.Inputs; SelectorCollection selectors = config.Selectors; ProcessorCollection processors = config.Processors; string firstProcName = null; if (processors.Count > 0) { firstProcName = processors[0].Name; } Dictionary <string, BaseInput> ret = new Dictionary <string, BaseInput>(); // create log data sources and selectors foreach (InputElement input in inputs) { Log.Info("input[" + input.Name + "]"); if (string.IsNullOrEmpty(input.Name)) { Log.Warn("input[" + input.Name + "] undefined input name"); continue; } foreach (SelectorElement selector in selectors) { if (!string.IsNullOrEmpty(selector.InputName) && selector.InputName != input.Name) { continue; } if (!string.IsNullOrEmpty(selector.InputType) && selector.InputType != input.Type) { continue; } // create input string clazzName = "F2B.inputs." + input.Type + "Input"; Type clazzType = Type.GetType(clazzName); if (clazzType == null) { Log.Error("input[" + input.Name + "]/selector[" + selector.Name + "]: unable to resolve class \"" + clazzName + "\""); } else { Log.Info("input[" + input.Name + "]/selector[" + selector.Name + "]: creating new " + clazzName + " input"); } ConstructorInfo ctor = clazzType.GetConstructor( new[] { typeof(InputElement), typeof(SelectorElement), typeof(EventQueue) }); BaseInput logInput = (BaseInput)ctor.Invoke(new object[] { input, selector, queue }); ret[input.Name + "/" + selector.Name] = logInput; } } return(ret); }
public IActionResult GetScheduleImage([FromBody] BaseInput input) { return(Content(_dialysisScheduleApp.GetReport(input.KeyValue))); }
// Start is called before the first frame update void Start() { input = GetComponent <BaseInput>(); rb = GetComponent <Rigidbody>(); }
protected override void InputHandling() { if (mInput == null) { mInput = new BaseInput(); } }
public GesturesRecognizer(BaseInput input) { this.input = input; }
// Use this for initialization void Start() { m_Input = GetComponent<BaseInput>(); }
public void Add(BaseInput input) { if (_inputs.Any(e => e.Id == input.Id)) throw new Exception("Already specified input: " + input.Id); // use protected member directly to avoid component status check on Inputs _inputs.Add(input); }
public RequestBase(string resource, string ugToken, BaseInput data) { _resource = resource; _ugToken = ugToken; _data = data; }