public void ButtonNo() { hpaction = ActionKind.Unset; selectedRotateDirection = 0; ChangeMovePoint(); HiddenCheckText(); }
// context.GetActionLibrary(1).DefineAction(100, normal, false, "action_xx", null, {expr, menu, object}); public void DefineAction(int actionid, ActionKind kind, ActionExecutionType execution, bool question, string func, string code, ActionArgumentType[] args) { if (!Actions.ContainsKey(actionid)) { Actions.Add(actionid, new ActionDefinition(kind, execution, question, func, code, args)); } }
static int GetActionArity(MethodInfo method, ActionKind kind) { int arity = 0; ParameterInfo[] args = method.GetParameters(); switch (kind) { case ActionKind.Start: foreach (ParameterInfo arg in args) { if (!arg.IsOut) { arity += 1; } } break; case ActionKind.Finish: foreach (ParameterInfo arg in args) { if (arg.IsOut) { arity += 1; } } //if (method.ReturnType != typeof(void)) arity += 1; break; default: //return arity = args.Length; break; } return(arity); }
private void UpdateAnimation() { ActionKind kind = ActionKind.Stand; if (GetComponent <Slide>() != null) { kind = ActionKind.Slide; } else if (_rb2d.velocity.y != 0) { kind = ActionKind.Jump; } else if (_handler.MoveDirection != Vector2.zero) { kind = ActionKind.Run; } else if (_anim.GetInteger("Action") == (int)ActionKind.Dead) { return; } else if (_anim.GetInteger("Action") == (int)ActionKind.Win) { return; } Debug.Log($"UpdateAnimation: resolve animation {_anim.GetInteger("Action")}"); if (_anim.GetInteger("Action") == (int)kind) { return; } _anim.SetInteger("Action", (int)kind); }
private void AssertTransition <TExpectedState>( ActionKind action, Action <TExpectedState> assert) where TExpectedState : LocalContextState { this.AssertTransition(action, TargetPredicate, assert); }
private static string headline(long year, long halfyear, ActionKind actionKind, int patients) { StringBuilder sb = new StringBuilder(); sb.Append("<big><big>SPD - NextAction</big></big> " + actionKind.ToString() + " " + year + " - " + halfyear + " " + patients + " Patients " + DateTime.Now.ToShortDateString() + Environment.NewLine); sb.Append("<br><br>" + Environment.NewLine); return sb.ToString(); }
//선택 중. void UpdateSelectWait() { // 선택됐는지 확인. BattlePanel[] panels = transform.GetComponentsInChildren <BattlePanel>(); foreach (BattlePanel p in panels) { if (p.IsSelected()) // 선택이 끝난 패널이 있다. { m_selected = p.m_actionKind; } } //선택・타임아웃에서 다음 상태로 바꿉니다 Timer timer = transform.GetComponentInChildren <Timer>(); if (m_selected != ActionKind.None || timer.IsTimeZero()) { //각 패널을 선택 후의 연출로 바꿉니다. foreach (BattlePanel p in panels) { p.ChangeSelectedState(); } timer.Stop(); m_state = State.Selected; } }
readonly Symbol[] parameterSorts; // the "sort" (abstract type) of each parameter #endregion Fields #region Constructors public ActionInfo(int arity, Symbol[] parameterSorts, ActionKind kind, List<ActionMethod> actionMethods) { this.arity = arity; this.parameterSorts = parameterSorts; this.kind = kind; this.actionMethods = actionMethods; }
readonly List <ActionMethod> actionMethods; // the preconditions and updates for this action public ActionInfo(int arity, Symbol[] parameterSorts, ActionKind kind, List <ActionMethod> actionMethods) { this.arity = arity; this.parameterSorts = parameterSorts; this.kind = kind; this.actionMethods = actionMethods; }
// 액션 수신. public bool ReceiveActionData(ref ActionKind actionKind, ref float actionTime) { byte[] data = new byte[1024]; // 데이터를 수신합니다. int recvSize = m_network.Receive(ref data, data.Length); if (recvSize < 0) { // 입력 정보를 수신하지 않았습니다. return(false); } // byte배열을 구조체로 변환합니다. actionKind = (ActionKind)data[0]; // byte[]형에서 short형으로 변환합니다. short netOrder = (short)BitConverter.ToUInt16(data, 1); // 호스트 바이트 오더로 변환합니다.. short hostOrder = IPAddress.NetworkToHostOrder(netOrder); // float 단위 시간으로 되돌립니다. actionTime = hostOrder / 1000.0f; return(true); }
static Func<ActionContext, Action> GetConstructorFor(ActionKind actionKind) { Func<ActionContext, Action> actionConstructor; if (!OuterActionConstructors.TryGetValue(actionKind, out actionConstructor)) throw new ArgumentOutOfRangeException("actionKind"); return actionConstructor; }
private void ReportDiagnostic(Action <Diagnostic> addDiagnostic, ActionKind actionKindBeingRun) { if (_actionKind == actionKindBeingRun) { var diagnostic = Diagnostic.Create(Descriptor, _invalidLocation); addDiagnostic(diagnostic); } }
private static String allPatients(ISPDBL patComp, IList<PatientData> patients, long year, long halfyear, ActionKind actionKind) { StringBuilder sb = new StringBuilder(); foreach(PatientData patient in patients) { sb.Append(onePatient(patient, patComp, year, halfyear, actionKind)); } return sb.ToString(); }
public void ButtonLeftRotate() { if (TM.IsPlayerTurn() && isActionDecide == false) { hpaction = ActionKind.RotateLeft; selectedRotateDirection = -1; } }
//PLayerのターンの処理 private void PlayerTurn() { //行動が未選択 if (hpaction == ActionKind.Unset) { //1,駒が選択された→カメラ切り替え 未選択の場合、元の番号を保持する int pieceChangeChechk = LM.GetSelectedPieces(); if (pieceChangeChechk > -1) { selectedPieceId = pieceChangeChechk; DisplayRestPieceNum(selectedPieceId); selectPiece = GameManager.ManagerStore.humanPlayer.GetPieceById(selectedPieceId); PCM.ChangeCamera(selectedPieceId); ChangeMovePoint(); } //2.Inputから何らかのオブジェクトを受け付けた→面か確認して、移動可能か確認する GameObject returnObj = null; if (Input.GetMouseButtonUp(0)) { returnObj = IM.GetTouchListner(); } if (returnObj != null) { Field.SurfaceInfo selectedSurFaceInfo = returnObj.GetComponent <Field.SurfaceInfo>(); if (selectedSurFaceInfo != null) { selectedFaceId = selectedSurFaceInfo.FaceId; foreach (int moveFace in selectAbsolutePieceMoveRange) { if (selectedFaceId == moveFace) { hpaction = ActionKind.Move; break; } } //駒が移動可能なマスでなければ-1に if (hpaction != ActionKind.Move) { selectedFaceId = -1; } } } } //行動が選択済みで、Yes、Noが未クリック else if (hpaction != ActionKind.Unset && isActionDecide == false) { DisplayCheckText(); } //確認画面でYesが押された else if (hpaction != ActionKind.Unset && isActionDecide == true) { HiddenCheckText(); ExcuteMotion(selectPiece, selectedFaceId, selectedRotateDirection); isNeedTurnStartInit = true; } }
/// <nodoc/> public DebugAction(ActionKind kind, Node node, IReadOnlyList <DisplayStackTraceEntry> callStack) { Contract.Requires(node != null); Contract.Requires(callStack != null); Kind = kind; Node = node; CallStack = callStack; }
public ActionDefinition(ActionKind kind, ActionExecutionType exec, bool question, string funcname, string code, ActionArgumentType[] args) { Kind = kind; ExecutionType = exec; IsQuestion = question; FunctionName = funcname; Code = code; Arguments = args; }
BufferedAction(ActionKind kind) { Kind = kind; IsTimeout = false; IsRemoveAll = false; QueryId = QueryMatchID.NullQuery; SingleArgs = null; GroupArgs = null; }
public ActionDefinition(ActionKind kind, ActionExecutionType exec, bool question, string funcname, string code, ActionArgumentType[] args) { Kind = kind; ExecutionType = exec; IsQuestion = question; FunctionName = funcname; Code = code; Arguments = args; }
public void SendAction(ActionKind action) { this.EnsureIsReady(); this.EnsureInitialState(); var actionStr = Constants.ActionKindToActionStringMappings[action]; Console.Out.WriteLine("{0}:{1}", this._state.Tick.ToString(CultureInfo.InvariantCulture), actionStr); Console.Out.Flush(); }
//プレイヤーのターン開始時の初期化 //キングを選択状態に。各種フラグをfalseに初期化。 private void TurnStartInit() { LM.DisplayList(); // ChangeMovePoint(); isNeedTurnStartInit = false; isActionDecide = false; isDisPlayForm = false; action = ActionKind.Unset; // HiddenCheckText(); }
public Action Compose(ActionKind actionKind, ActionContext context) { Guard.That(context).IsNotNull(); var actionConstructor = GetConstructorFor(actionKind); var action = actionConstructor(context); var prepareWorkspaceAction = NewPrepareWorkspaceAction(context); return (Action) Delegate.Combine(prepareWorkspaceAction, action); }
private void ButtonStartBot_Click(object sender, EventArgs e) { SetControlsEnabled(false); prBarSong.Value = 0; prBarSong.Maximum = 100; actionKind = ActionKind.LoadMainPage; nextSong = -1; webBrowser.DocumentCompleted += WebBrowser_DocumentCompleted; GoToMainPage(); }
static Func <ActionContext, Action> GetConstructorFor(ActionKind actionKind) { Func <ActionContext, Action> actionConstructor; if (!OuterActionConstructors.TryGetValue(actionKind, out actionConstructor)) { throw new ArgumentOutOfRangeException("actionKind"); } return(actionConstructor); }
public Action Compose(ActionKind actionKind, ActionContext context) { Guard.That(context).IsNotNull(); var actionConstructor = GetConstructorFor(actionKind); var action = actionConstructor(context); var prepareWorkspaceAction = NewPrepareWorkspaceAction(context); return((Action)Delegate.Combine(prepareWorkspaceAction, action)); }
//プレイヤーのターン開始時の初期化 //キングを選択状態に。各種フラグをfalseに初期化。 private void TurnStartInit() { DisplayRestPieceNum(selectedPieceId); LM.DisplayList(); ChangeMovePoint(); isNeedTurnStartInit = false; isActionDecide = false; isDisPlayForm = false; hpaction = ActionKind.Unset; HiddenCheckText(); selectedRotateDirection = 0; selectedFaceId = -1; }
public Action(string line) { Kind = line[0] switch { 'N' => ActionKind.North, 'S' => ActionKind.South, 'E' => ActionKind.East, 'W' => ActionKind.West, 'L' => ActionKind.Left, 'R' => ActionKind.Right, 'F' => ActionKind.Forward, _ => throw new InvalidDataException() }; Value = int.Parse(line[1..]);
/// <summary> /// Создавет экземпляр UndoAction по нынешнему состоянию точки /// При kind == move, параметр newParent обязателен /// </summary> /// <param name="point">Исходная точка</param> /// <param name="parent">Исходный родитель точки</param> /// <param name="kind">Тип действия</param> private UndoUnit CreateUndoUnit(PointOfInterest point, PointOfInterest parent, ActionKind kind, PointOfInterest newParent = null) { if (kind == ActionKind.Move && newParent == null) throw new ArgumentException(); UndoUnit undo = new UndoUnit(); undo.Kind = kind; undo.OriginalParent = parent; undo.OriginalPosition = parent == null ? 0 : parent.Items.IndexOf(point); undo.OriginalPointRef = point; if (kind == ActionKind.Edit) undo.OriginalPointContent = point.ClonePointAssignItems(); if (kind == ActionKind.Move) undo.OriginalPointContent = newParent; return undo; }
public static string getFullHtml(ISPDBL patComp, long year, long halfyear, ActionKind actionKind) { StringBuilder sb = new StringBuilder(); IList<PatientData> patients = patComp.FindPatientsWithNextAction(year, halfyear, actionKind); sb.Append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"" + Environment.NewLine); sb.Append("\"http://www.w3.org/TR/html4/loose.dtd\">" + Environment.NewLine); sb.Append("<html><head><title>SPD-NextAction</title>" + Environment.NewLine); sb.Append(css()); sb.Append("</head>" + Environment.NewLine + "<body>" + Environment.NewLine); sb.Append("<table style='width:100%'>"); sb.Append(headline(year, halfyear, actionKind, patients.Count)); sb.Append(allPatients(patComp, patients, year, halfyear, actionKind)); sb.Append("</table>" + Environment.NewLine); sb.Append("</body>" + Environment.NewLine + "</html>"); return sb.ToString(); }
public void ChangeAnimationAction(ActionKind action) { //서버 클라이언트에서의 판정만 할 수 있으므로 Winner.serverPlayer면 자신의 승리로 다룹니다. Winner rpsWinner = ResultChecker.GetRPSWinner(m_rps, m_opponentRps); switch (rpsWinner) { case Winner.ServerPlayer: //가위바위보는 자신의 승리. if (action == ActionKind.Attack) { ChangeAnimationAttack(); } else if (action == ActionKind.Block) { ChangeAnimation(Motion.Defence); } break; case Winner.ClientPlayer: //가위바위보는 자신의 패배. if (action == ActionKind.Attack) { ChangeAnimationMiss(); } else if (action == ActionKind.Block) { ChangeAnimation(Motion.Defence); } break; case Winner.Draw: //가위바위보는 무승부. if (action == ActionKind.Attack) { ChangeAnimationMiss(); } else if (action == ActionKind.Block) { ChangeAnimation(Motion.Defence); } break; } //Debug.Log(m_currentMotion.ToString() + m_anim[m_currentMotion.ToString()].length); //Debug.Log(m_anim[m_currentMotion.ToString()].speed); //Debug.Log(m_anim[m_currentMotion.ToString()].normalizedTime); m_anim[m_currentMotion.ToString()].speed = 0.1f; //느리게 재생. }
// 액션 송신. public void SendActionData(ActionKind actionKind, float actionTime) { // 구조체를 byte 배열로 변환합니다. byte[] data = new byte[3]; data[0] = (byte) actionKind; // 정수화합니다. short actTime = (short)(actionTime * 1000.0f); // 네트워크 바이트오더로 변환합니다. short netOrder = IPAddress.HostToNetworkOrder(actTime); // byte[] 형으로 변환합니다. byte[] conv = BitConverter.GetBytes(netOrder); data[1] = conv[0]; data[2] = conv[1]; // 데이터를 송신합니다. m_network.Send(data, data.Length); }
// 액션 송신. public void SendActionData(ActionKind actionKind, float actionTime) { // 구조체를 byte 배열로 변환합니다. byte[] data = new byte[3]; data[0] = (byte)actionKind; // 정수화합니다. short actTime = (short)(actionTime * 1000.0f); // 네트워크 바이트오더로 변환합니다. short netOrder = IPAddress.HostToNetworkOrder(actTime); // byte[] 형으로 변환합니다. byte[] conv = BitConverter.GetBytes(netOrder); data[1] = conv[0]; data[2] = conv[1]; // 데이터를 송신합니다. m_network.Send(data, data.Length); }
//動作確認のYesNoのディスプレイを表示 private bool DisplayCheckText() { bool returnValue = false; //キングが回転しないようにする(8/27 きすけ) if (selectPiece.GetKind() == PieceKind.King && (hpaction == ActionKind.RotateRight || hpaction == ActionKind.RotateLeft) && isActionDecide == false) { hpaction = ActionKind.Unset; return(false); } if (isDisPlayForm == false && hpaction != ActionKind.Unset && isActionDecide == false) { IM.RockOn(); if (hpaction == ActionKind.Move) { List <int> tes = new List <int>(); tes.Add(selectedFaceId); ManagerStore.fieldManager.PointMovableFace(tes); //checkText.text = selectedFaceId + "に移動しますが宜しいですか"; checkText.text = "このマスに移動しますか"; returnValue = true; } else if (hpaction == ActionKind.RotateRight) { checkText.text = "右に回転しますか"; returnValue = true; } else if (hpaction == ActionKind.RotateLeft) { checkText.text = "左に回転しますか"; returnValue = true; } isDisPlayForm = true; checkMenue.SetActive(true); } return(returnValue); }
//各種アクションを実行 //これは制御結合だ!最悪。しかし教訓のため残しておこう //(直すのが面倒とかではない) public void DoAction(ActionKind actionKind) { switch (actionKind) { case ActionKind.rotateRight: MapChip.Angle += 90; break; case ActionKind.rotateLeft: MapChip.Angle += 270; break; case ActionKind.TurnVertical: MapChip.TurnVertical(); break; case ActionKind.TurnHorizontal: MapChip.TurnHorizontal(); break; } }
internal ActionInfo(object model, MethodInfo method, ActionKind kind, ModelProgramProvider mpp) { this.actionSymbol = new ActionSymbol(GetActionName(method), GetActionArity(method, kind), kind); this.model = model; this.method = method; this.inputParameterTypes = GetInputParameterTypes(method); this.parameterlessEnablingCondition = new EnablingCondition(this, true, true); this.enablingCondition = new EnablingCondition(this, true, false); this.parameterInfos = method.GetParameters(); defaultInputParameters = new object[inputParameterTypes.Length]; for (int i = 0; i < defaultInputParameters.Length; i++) { defaultInputParameters[i] = (mpp.GetEnumDomain(inputParameterTypes[i]).Values.Length == 0 ? 0 : mpp.GetEnumDomain(inputParameterTypes[i]).Values[0]); } //Create input parameter generators InitializeInputParameterCombinations(mpp, new EnablingCondition(this, false, false)); }
private void timer_Tick(object sender, EventArgs e) { switch (_action) { case ActionKind.Wait: timer.Interval = 5000; _action = ActionKind.Close; break; case ActionKind.Start: timer.Interval = 1; Opacity += 0.1; if (_x < Location.X) { Left--; } else { if (Opacity == 1.0) { _action = ActionKind.Wait; } } break; case ActionKind.Close: timer.Interval = 1; Opacity -= 0.1; Left -= 3; if (base.Opacity == 0.0) { base.Close(); } break; default: break; } }
//선택 중. void UpdateSelectWait() { // 선택됐는지 확인. BattlePanel[] panels = transform.GetComponentsInChildren<BattlePanel>(); foreach (BattlePanel p in panels) { if (p.IsSelected()) { // 선택이 끝난 패널이 있다. m_selected = p.m_actionKind; } } //선택・타임아웃에서 다음 상태로 바꿉니다 Timer timer = transform.GetComponentInChildren<Timer>(); if (m_selected != ActionKind.None || timer.IsTimeZero()) { //각 패널을 선택 후의 연출로 바꿉니다. foreach (BattlePanel p in panels) { p.ChangeSelectedState(); } timer.Stop(); m_state = State.Selected; } }
private static String onePatient(PatientData patient, ISPDBL patComp, long year, long halfyear, ActionKind actionKind) { StringBuilder sb = new StringBuilder(); OperationData operation = patComp.GetLastOperationByPatientID(patient.Id); VisitData visit = patComp.GetLastVisitByPatientID(patient.Id); StringBuilder toDoSB = new StringBuilder(); foreach (NextActionData nextAction in patComp.GetNextActionsByPatientID(patient.Id)) { if (nextAction.ActionYear == year && nextAction.ActionhalfYear == halfyear && nextAction.ActionKind == actionKind && !String.IsNullOrEmpty(nextAction.Todo)) { toDoSB.Append(nextAction.Todo); } } sb.Append(firstLine(patient)); sb.Append(name(patient)); sb.Append(opDiagnoses(operation)); sb.Append(visitDiagnoses(visit)); sb.Append(visitTherapy(visit)); sb.Append(toDo(toDoSB.ToString())); sb.Append(seperator()); return sb.ToString(); }
// Use this for initialization void Start () { m_selected = ActionKind.None; m_state = State.SelectWait; }
public void Alert(string caption, string message = "", AlertKind alertKind = AlertKind.Primary) { Opacity = 0.0; StartPosition = FormStartPosition.Manual; string instance; for (int i = 1; i < 10; i++) { instance = "noty" + i.ToString(); Noty f = (Noty)Application.OpenForms[instance]; if (f == null) { this.Name = instance; _x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; _y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; Location = new Point(_x, _y); break; } } _x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; Caption.Text = caption; Message.Text = message; switch (alertKind) { case AlertKind.Primary: Icon.Image = Resources.info; SetBackColor(93, 156, 236); // blue jeans SetBorderColor(74, 137, 220); // hover SetCaptionColor(21, 61, 115); break; case AlertKind.Secondary: Icon.Image = Resources.info; SetBackColor(101, 109, 120); // dark gray SetBorderColor(67, 74, 84); // hover SetCaptionColor(27, 30, 36); break; case AlertKind.Success: Icon.Image = Resources.success; SetBackColor(160, 212, 104); // grass SetBorderColor(140, 193, 82); // hover SetCaptionColor(49, 89, 5); break; case AlertKind.Info: Icon.Image = Resources.info; SetBackColor(79, 193, 233); // aqua SetBorderColor(59, 175, 218); // hover SetCaptionColor(12, 98, 130); break; case AlertKind.Warning: Icon.Image = Resources.warning; SetBackColor(255, 206, 84); // sunflower SetBorderColor(252, 187, 66); // hover SetCaptionColor(161, 107, 10); break; case AlertKind.Error: Icon.Image = Resources.error; SetBackColor(237, 85, 101); // grapefruit SetBorderColor(218, 68, 83); // hover SetCaptionColor(110, 21, 30); break; case AlertKind.Reminder: Icon.Image = Resources.warning; SetBackColor(252, 110, 81); // grapefruit SetBorderColor(233, 87, 63); // hover SetCaptionColor(135, 31, 14); break; default: Icon.Image = Resources.info; SetBackColor(93, 156, 236); // blue jeans SetBorderColor(74, 137, 220); // hover SetCaptionColor(32, 77, 138); break; } Show(); _action = ActionKind.Start; timer.Interval = 1; timer.Start(); }
/// <summary> /// Сохраняет состояние точки перед действием /// Вызывается при любом изменении аспектного дерева /// </summary> /// <param name="point">Исходная точка</param> /// <param name="parent">Исходный родитель точки</param> /// <param name="kind">Тип действия</param> public void SavePointState(PointOfInterest point, PointOfInterest parent, ActionKind kind, PointOfInterest newParent = null) { UndoStack.Push(CreateUndoUnit(point, parent, kind, newParent)); RedoStack.Clear(); }
public mvResponseActionItem(ActionKind actionKind, params object[] p) { _prms = p; _actionKind = actionKind; }
private void DrawNextActionFaxListHeadline(IList<PatientData> patients, PrintablePage pp, ActionKind actionKind, long halfYear, long year, int page, Font headlineFont, float leftMargin, float topMargin, Font tableHeadFont, int xId, int xName, int xAge, int xSex, int xPhone, int xDiagnoses) { pp.AddPrintableObject(new PrintableTextObject("SPD - NextAction - FAX List " + actionKind.ToString() + " " + halfYear + "/" + year + " Page: " + page + " No of Patients: " + patients.Count, headlineFont, Brushes.Black, leftMargin, topMargin)); //TableHead pp.AddPrintableObject(new PrintableFillRectangleObject(Brushes.LightGray, (int)leftMargin, (int)topMargin + 22, 1109, 16)); pp.AddPrintableObject(new PrintableTextObject("ID", tableHeadFont, Brushes.Black, xId, topMargin + 23)); pp.AddPrintableObject(new PrintableTextObject("Name", tableHeadFont, Brushes.Black, xName, topMargin + 23)); pp.AddPrintableObject(new PrintableTextObject("Age", tableHeadFont, Brushes.Black, xAge, topMargin + 23)); pp.AddPrintableObject(new PrintableTextObject("Sex", tableHeadFont, Brushes.Black, xSex, topMargin + 23)); pp.AddPrintableObject(new PrintableTextObject("Phone", tableHeadFont, Brushes.Black, xPhone, topMargin + 23)); pp.AddPrintableObject(new PrintableTextObject("Diagnoses", tableHeadFont, Brushes.Black, xDiagnoses, topMargin + 23)); }
/// <summary> /// Finds the patients with next action. /// </summary> /// <param name="year">The year.</param> /// <param name="halfYear">The half year.</param> /// <param name="actionKind">Kind of the action.</param> /// <returns></returns> public IList<PatientData> FindPatientsWithNextAction(long year, long halfYear, ActionKind actionKind) { using (ChannelFactory<ISPDBL> cf = new ChannelFactory<ISPDBL>(binding, endpointAddress)) { ISPDBL spdBL = cf.CreateChannel(); return spdBL.FindPatientsWithNextAction(year, halfYear, actionKind); } }
// context.GetActionLibrary(1).DefineAction(100, normal, false, "action_xx", null, {expr, menu, object}); public void DefineAction(int actionid, ActionKind kind, ActionExecutionType execution, bool question, string func, string code, ActionArgumentType[] args) { if (!Actions.ContainsKey(actionid)) Actions.Add(actionid, new ActionDefinition(kind, execution, question, func, code, args)); }
public void AddActionItem(ActionKind actionKind, params object[] prms) { var item = new mvResponseActionItem(actionKind, prms); _items.Add(item); }
/// <summary> /// Initializes a new instance of the <see cref="NextActionData"/> class. /// </summary> /// <param name="nextActionID">The next action ID.</param> /// <param name="patientID">The patient ID.</param> /// <param name="actionKind">Kind of the action.</param> /// <param name="actionYear">The action year.</param> /// <param name="actionhalfYear">The actionhalf year.</param> /// <param name="todo">ToDo.</param> public NextActionData(long nextActionID, long patientID, ActionKind actionKind, long actionYear, long actionhalfYear, string todo) { this.nextActionID = nextActionID; this.patientID = patientID; this.actionKind = actionKind; this.actionYear = actionYear; this.actionhalfYear = actionhalfYear; this.todo = todo; }
/// <summary> /// Prints the next action list. /// </summary> /// <param name="patients">The patients.</param> /// <param name="year">The year.</param> /// <param name="halfyear">The halfyear.</param> /// <param name="actionKind">Kind of the action.</param> public void PrintNextActionList(IList<PatientData> patients, long year, long halfyear, ActionKind actionKind) { if (patients == null || patients.Count == 0) { return; } PrintableDocument pd = new PrintableDocument(); pd.DocumentName = "SPD Next Action List"; pd.Landscape = false; Font headlineFont = new Font("Arial", 13.0f, FontStyle.Bold); Font dateFont = new Font("Arial", 10.5f, FontStyle.Bold); Font printFont = new Font("Arial", 11, FontStyle.Regular); Font boldPrintFont = new Font("Arial", 11, FontStyle.Bold); Font barCodeFont = null; if (StaticUtilities.IsFontInstalled("Free 3 of 9 Extended") && SPD.GUI.Properties.Settings.Default.Barcode) { barCodeFont = new Font("Free 3 of 9 Extended", 30, FontStyle.Regular, GraphicsUnit.Point); } float leftMargin = 65; float topMargin = 30; int page = 1; int line = 2; PrintablePage pp = new PrintablePage(); pp.AddPrintableObject(new PrintableTextObject("SPD - NextAction - " + actionKind.ToString(), headlineFont, Brushes.Black, leftMargin, topMargin + (float)(0 * 17.56))); pp.AddPrintableObject(new PrintableTextObject(year + " - " + halfyear + " " + patients.Count + " Patients", printFont, Brushes.Black, leftMargin + 300, topMargin + 3 + (float)(0 * 17.56))); pp.AddPrintableObject(new PrintableTextObject(DateTime.Now.ToShortDateString() + " Page: " + page, printFont, Brushes.Black, leftMargin + 545, topMargin + 3 + (float)(0 * 17.56))); pp.AddPrintableObject(new PrintableLineObject(Pens.Black, (int)leftMargin, (int)topMargin + 20, (int)leftMargin + 680, (int)topMargin + 20)); foreach (PatientData patient in patients) { pp.AddPrintableObject(new PrintableTextObject("ID: " + patient.Id, printFont, Brushes.Black, leftMargin, topMargin + (float)(line * 17.56))); pp.AddPrintableObject(new PrintableTextObject("Sex: " + patient.Sex, printFont, Brushes.Black, leftMargin + 100, topMargin + (float)(line * 17.56))); pp.AddPrintableObject(new PrintableTextObject("Phone: " + patient.Phone, printFont, Brushes.Black, leftMargin + 200, topMargin + (float)(line * 17.56))); pp.AddPrintableObject(new PrintableTextObject("Birthdate: " + patient.DateOfBirth.ToShortDateString() + " - " + CommonUtilities.StaticUtilities.getAgeFromBirthDate(patient.DateOfBirth) + " years", printFont, Brushes.Black, leftMargin + 450, topMargin + (float)(line * 17.56))); line++; if (barCodeFont != null) { pp.AddPrintableObject(new PrintableTextObject(String.Format("*000000{0}*", patient.Id.ToString()), barCodeFont, Brushes.Black, 500, topMargin + (float)(line * 17.56))); } pp.AddPrintableObject(new PrintableTextObject("Name: " + patient.FirstName + " " + patient.SurName, printFont, Brushes.Black, leftMargin, topMargin + (float)(line * 17.56))); line++; List<string> extradiagnoses = new List<string>(); OperationData operation = this.patComp.GetLastOperationByPatientID(patient.Id); VisitData visit = this.patComp.GetLastVisitByPatientID(patient.Id); if (operation != null && !String.IsNullOrEmpty(operation.Diagnoses)) { extradiagnoses.Add(operation.Diagnoses); extradiagnoses = this.SplitStringsForPrinting(80, extradiagnoses); pp.AddPrintableObject(new PrintableTextObject("OP Diagnoses:", boldPrintFont, Brushes.Black, leftMargin, topMargin + (float)(line * 17.56))); line++; foreach (string diagnosesLine in extradiagnoses) { pp.AddPrintableObject(new PrintableTextObject(diagnosesLine, printFont, Brushes.Black, leftMargin, topMargin + (float)(line * 17.56))); line++; } } if (visit != null && !String.IsNullOrEmpty(visit.ExtraDiagnosis)) { extradiagnoses.Add(visit.ExtraDiagnosis); extradiagnoses = this.SplitStringsForPrinting(80, extradiagnoses); pp.AddPrintableObject(new PrintableTextObject("Visit Diagnoses:", boldPrintFont, Brushes.Black, leftMargin, topMargin + (float)(line * 17.56))); line++; foreach (string diagnosesLine in extradiagnoses) { pp.AddPrintableObject(new PrintableTextObject(diagnosesLine, printFont, Brushes.Black, leftMargin, topMargin + (float)(line * 17.56))); line++; } } //Therapy if (visit != null && !String.IsNullOrEmpty(visit.ExtraTherapy)) { List<string> therapy = new List<string>(); therapy.Add(visit.ExtraTherapy); therapy = this.SplitStringsForPrinting(80, therapy); pp.AddPrintableObject(new PrintableTextObject("Visit Therapy:", boldPrintFont, Brushes.Black, leftMargin, topMargin + (float)(line * 17.56))); line++; foreach (string therapyLine in therapy) { pp.AddPrintableObject(new PrintableTextObject(therapyLine, printFont, Brushes.Black, leftMargin, topMargin + (float)(line * 17.56))); line++; } } //TODO List<string> todo = new List<string>(); foreach(NextActionData nextAction in patComp.GetNextActionsByPatientID(patient.Id)) { if (nextAction.ActionYear == year && nextAction.ActionhalfYear == halfyear && nextAction.ActionKind == actionKind && !String.IsNullOrEmpty(nextAction.Todo)) { todo.Add(nextAction.Todo); } } if (todo.Count > 0) { pp.AddPrintableObject(new PrintableTextObject("ToDo:", boldPrintFont, Brushes.Black, leftMargin, topMargin + (float)(line * 17.56))); line++; todo = this.SplitStringsForPrinting(80, todo); foreach (string todoLine in todo) { pp.AddPrintableObject(new PrintableTextObject(todoLine, printFont, Brushes.Black, leftMargin, topMargin + (float)(line * 17.56))); line++; } } pp.AddPrintableObject(new PrintableLineObject(Pens.Black, (int)leftMargin, (int)((line + 2) * 17.56), (int)leftMargin + 680, (int)((line + 2) * 17.56))); line++; if (line > 50) { page++; pd.AddPrintPage(pp); pp = new PrintablePage(); line = 2; pp.AddPrintableObject(new PrintableTextObject("NextAction - " + actionKind.ToString() + " " + year + "\\" + halfyear + " " + patients.Count + " Patients", headlineFont, Brushes.Black, leftMargin, topMargin + (float)(0 * 17.56))); pp.AddPrintableObject(new PrintableTextObject("SPD", headlineFont, Brushes.Black, leftMargin + 400, topMargin + (float)(0 * 17.56))); pp.AddPrintableObject(new PrintableTextObject(DateTime.Now.ToShortDateString() + " Page: " + page, headlineFont, Brushes.Black, leftMargin + 500, topMargin + (float)(0 * 17.56))); pp.AddPrintableObject(new PrintableLineObject(Pens.Black, (int)leftMargin, (int)topMargin + 20, (int)leftMargin + 680, (int)topMargin + 20)); } } pd.AddPrintPage(pp); pd.DoPrint(); }
public GameAction(String name, ActionKind behavior) { this.name = name; this.behavior = behavior; Reset(); }
public void ChangeAnimationAction(ActionKind action) { //서버 클라이언트에서의 판정만 할 수 있으므로 Winner.serverPlayer면 자신의 승리로 다룹니다. Winner rpsWinner = ResultChecker.GetRPSWinner(m_rps, m_opponentRps); switch (rpsWinner) { case Winner.ServerPlayer: //가위바위보는 자신의 승리. if (action == ActionKind.Attack) { ChangeAnimationAttack(); } else if (action == ActionKind.Block) { ChangeAnimation(Motion.Defence); } break; case Winner.ClientPlayer: //가위바위보는 자신의 패배. if (action == ActionKind.Attack) { ChangeAnimationMiss(); } else if (action == ActionKind.Block) { ChangeAnimation(Motion.Defence); } break; case Winner.Draw: //가위바위보는 무승부. if (action == ActionKind.Attack) { ChangeAnimationMiss(); } else if (action == ActionKind.Block) { ChangeAnimation(Motion.Defence); } break; } //Debug.Log(m_currentMotion.ToString() + m_anim[m_currentMotion.ToString()].length); //Debug.Log(m_anim[m_currentMotion.ToString()].speed); //Debug.Log(m_anim[m_currentMotion.ToString()].normalizedTime); m_anim[m_currentMotion.ToString()].speed = 0.1f; //느리게 재생. }
public AnalyzerWithInvalidDiagnosticLocation(SyntaxTree treeInAnotherCompilation, ActionKind actionKind) { _invalidLocation = treeInAnotherCompilation.GetRoot().GetLocation(); _actionKind = actionKind; }
private AttackUpdateEventArgs(IEnumerable<AttackPlanFrom> attackFrom, ActionKind action) { AttackFrom = attackFrom.ToArray(); Action = action; }
public OperationAnalyzer(ActionKind actionKind) { _actionKind = actionKind; }
/// <summary> /// Finds the patients with next action. /// </summary> /// <param name="year">The year.</param> /// <param name="halfYear">The half year.</param> /// <param name="actionKind">Kind of the action.</param> /// <returns></returns> public override IList<PatientData> FindPatientsWithNextAction(long year, long halfYear, ActionKind actionKind) { if (nextActionBuffer == null) { nextActionBuffer = base.GetAllNextActions(); } IList<PatientData> patientList = new List<PatientData>(); List<long> patientIdsList = new List<long>(); foreach (NextActionData nextAction in nextActionBuffer) { if (nextAction.ActionYear == year && nextAction.ActionhalfYear == halfYear && nextAction.ActionKind == actionKind) { patientIdsList.Add(nextAction.PatientID); } } patientIdsList.Sort(); foreach (long patientId in patientIdsList) { patientList.Add(this.FindPatientById(patientId)); } return patientList; }
/// <summary> /// Prints the next action faxlist. /// </summary> /// <param name="patients">List of Patients</param> /// <param name="year">The year.</param> /// <param name="halfYear">The half year.</param> /// <param name="actionKind">Kind of the action.</param> public void PrintNextActionFaxlist(IList<PatientData> patients, long year, long halfYear, ActionKind actionKind) { if (patients == null || patients.Count == 0) { return; } PrintableDocument pd = new PrintableDocument(); pd.DocumentName = "SPD Next Action Fax List"; pd.Landscape = true; Font headlineFont = new Font("Arial", 13.0f, FontStyle.Bold); Font tableHeadFont = new Font("Arial", 10, FontStyle.Bold); Font printFont = new Font("Arial", 10, FontStyle.Regular); float leftMargin = 30; float topMargin = 30; int page = 1; int xId = (int)leftMargin; int xName = 70; int xAge = 350; int xSex = 400; int xPhone = 450; int xDiagnoses = 600; // private int A4smallSite = 826; //private int A4LargeSite = 1169; PrintablePage pp = new PrintablePage(); int yTable = (int)topMargin + 22; //Headline DrawNextActionFaxListHeadline(patients, pp, actionKind, halfYear, year, page, headlineFont, leftMargin, topMargin, tableHeadFont, xId, xName, xAge, xSex, xPhone, xDiagnoses); int patientCount = 0; foreach (PatientData patient in patients) { //pp.AddPrintableObject(new PrintableLineObject(Pens.Black, (int)leftMargin, yTable, (int)leftMargin + 1109, yTable)); pp.AddPrintableObject(new PrintableTextObject(patient.Id.ToString(), printFont, Brushes.Black, xId, yTable + 1 + 16 + (patientCount * 16))); pp.AddPrintableObject(new PrintableRectangleObject(Brushes.White, xName, yTable + 1 + 16 + (patientCount * 16), 1000, 16)); pp.AddPrintableObject(new PrintableTextObject(patient.FirstName + " " + patient.SurName, printFont, Brushes.Black, xName, yTable + 1 + 16 + (patientCount * 16))); pp.AddPrintableObject(new PrintableRectangleObject(Brushes.White, xAge, yTable + 1 + 16 + (patientCount * 16), 1000, 16)); pp.AddPrintableObject(new PrintableTextObject(StaticUtilities.getAgeFromBirthDate(patient.DateOfBirth), printFont, Brushes.Black, xAge, yTable + 1 + 16 + (patientCount * 16))); pp.AddPrintableObject(new PrintableRectangleObject(Brushes.White, xSex, yTable + 1 + 16 + (patientCount * 16), 1000, 16)); pp.AddPrintableObject(new PrintableTextObject(patient.Sex.ToString() , printFont, Brushes.Black, xSex, yTable + 1 + 16 + (patientCount * 16))); pp.AddPrintableObject(new PrintableRectangleObject(Brushes.White, xPhone, yTable + 1 + 16 + (patientCount * 16), 1000, 16)); pp.AddPrintableObject(new PrintableTextObject(patient.Phone , printFont, Brushes.Black, xPhone, yTable + 1 + 16 + (patientCount * 16))); pp.AddPrintableObject(new PrintableRectangleObject(Brushes.White, xDiagnoses, yTable + 1 + 16 + (patientCount * 16), 1000, 16)); string diagnoses = string.Empty; OperationData op = patComp.GetLastOperationByPatientID(patient.Id); if (op != null && !string.IsNullOrEmpty(op.Diagnoses)) { diagnoses = "OP: " + op.Diagnoses; } else { VisitData visit = patComp.GetLastVisitByPatientID(patient.Id); if (visit != null && !string.IsNullOrEmpty(visit.ExtraDiagnosis)) { diagnoses = "Visit: " + visit.ExtraDiagnosis; } } pp.AddPrintableObject(new PrintableTextObject(diagnoses, printFont, Brushes.Black, xDiagnoses, yTable + 1 + 16 + (patientCount * 16))); pp.AddPrintableObject(new PrintableRectangleObject(Brushes.White, (int)leftMargin + 1109, yTable + 1 + 16 + (patientCount * 16), 1000, 16)); patientCount++; if (patientCount > 45) { drawNextActionFaxListTable(pp, leftMargin, yTable, xId, xName, xAge, xSex, xPhone, xDiagnoses); page++; pd.AddPrintPage(pp); pp = new PrintablePage(); patientCount = 0; DrawNextActionFaxListHeadline(patients, pp, actionKind, halfYear, year, page, headlineFont, leftMargin, topMargin, tableHeadFont, xId, xName, xAge, xSex, xPhone, xDiagnoses); } } drawNextActionFaxListTable(pp, leftMargin, yTable, xId, xName, xAge, xSex, xPhone, xDiagnoses); pd.AddPrintPage(pp); pd.DoPrint(); }
static int GetActionArity(MethodInfo method, ActionKind kind) { int arity = 0; ParameterInfo[] args = method.GetParameters(); switch (kind) { case ActionKind.Start: foreach (ParameterInfo arg in args) if (!arg.IsOut) arity += 1; break; case ActionKind.Finish: foreach (ParameterInfo arg in args) if (arg.IsOut) arity += 1; //if (method.ReturnType != typeof(void)) arity += 1; break; default: //return arity = args.Length; break; } return arity; }
internal ActionInfo(object model, MethodInfo method, ActionKind kind, ModelProgramProvider mpp) { this.actionSymbol = new ActionSymbol(GetActionName(method), GetActionArity(method, kind), kind); this.model = model; this.method = method; this.inputParameterTypes = GetInputParameterTypes(method); this.parameterlessEnablingCondition = new EnablingCondition(this, true, true); this.enablingCondition = new EnablingCondition(this, true, false); this.parameterInfos = method.GetParameters(); defaultInputParameters = new object[inputParameterTypes.Length]; for (int i = 0; i < defaultInputParameters.Length; i++) defaultInputParameters[i] = (mpp.GetEnumDomain(inputParameterTypes[i]).Values.Length == 0 ? 0 : mpp.GetEnumDomain(inputParameterTypes[i]).Values[0]); //Create input parameter generators InitializeInputParameterCombinations(mpp, new EnablingCondition(this, false, false)); }
// 액션 수신. public bool ReceiveActionData(ref ActionKind actionKind, ref float actionTime) { byte[] data = new byte[1024]; // 데이터를 수신합니다. int recvSize = m_network.Receive(ref data, data.Length); if (recvSize < 0) { // 입력 정보를 수신하지 않았습니다. return false; } // byte배열을 구조체로 변환합니다. actionKind = (ActionKind) data[0]; // byte[]형에서 short형으로 변환합니다. short netOrder = (short) BitConverter.ToUInt16(data, 1); // 호스트 바이트 오더로 변환합니다.. short hostOrder = IPAddress.NetworkToHostOrder(netOrder); // float 단위 시간으로 되돌립니다. actionTime = hostOrder / 1000.0f; return true; }
public IList<long> FindPatientIdsByYearHalfYearAndActionKind(long year, long halfYear, ActionKind actionKind) { try { long tstart = DateTime.Now.Ticks; DbUtil.OpenConnection(); if (findPatientIdByYearHalfYearActionDataCmd == null) { findPatientIdByYearHalfYearActionDataCmd = DbUtil.CreateCommand(SQL_FIND_PATIENTID_BY_YEAR_HALFYEAR_ACTIONKIND, DbUtil.CurrentConnection); findPatientIdByYearHalfYearActionDataCmd.Parameters.Add(DbUtil.CreateParameter("@actionyear", DbType.Int64)); findPatientIdByYearHalfYearActionDataCmd.Parameters.Add(DbUtil.CreateParameter("@actionhalfyear", DbType.Int64)); findPatientIdByYearHalfYearActionDataCmd.Parameters.Add(DbUtil.CreateParameter("@actionkind", DbType.Int64)); } ((IDataParameter)findPatientIdByYearHalfYearActionDataCmd.Parameters["@actionyear"]).Value = year; ((IDataParameter)findPatientIdByYearHalfYearActionDataCmd.Parameters["@actionhalfyear"]).Value = halfYear; ((IDataParameter)findPatientIdByYearHalfYearActionDataCmd.Parameters["@actionkind"]).Value = (long)actionKind; using (IDataReader rdr = findPatientIdByYearHalfYearActionDataCmd.ExecuteReader()) { IList<long> patientIds = new List<long>(); while (rdr.Read()) { patientIds.Add((long)(int)rdr["PatientID"]); } long tend = DateTime.Now.Ticks; log.Info("Find PatientIds By Year HalfYear And ActionKind Year: " + year + " HalfYear: " + halfYear + " ActionKind: " + actionKind.ToString() + " Count: " + patientIds.Count + " " + ((tend - tstart) / 10000) + "ms"); return patientIds; } } catch (Exception e) { log.Error(e.Message); throw e; } finally { DbUtil.CloseConnection(); } }
/// <summary> /// Finds the patients with next action. /// </summary> /// <param name="year">The year.</param> /// <param name="halfYear">The half year.</param> /// <param name="actionKind">Kind of the action.</param> /// <returns></returns> public virtual IList<PatientData> FindPatientsWithNextAction(long year, long halfYear, ActionKind actionKind) { INextAction nextActionDB = Database.CreateNextAction(); IList<PatientData> patientList = new List<PatientData>(); IList<long> patientIds = nextActionDB.FindPatientIdsByYearHalfYearAndActionKind(year, halfYear, actionKind); List<long> patientIdsList = new List<long>(patientIds); patientIdsList.Sort(); foreach (long patientId in patientIdsList) { patientList.Add(this.FindPatientById(patientId)); } return patientList; }