Exemple #1
0
 public NoteResultTO(NoteResult mdoResult)
 {
     this.id           = mdoResult.Id;
     this.totalPages   = mdoResult.TotalPages;
     this.lastPageRecd = mdoResult.LastPageRecd;
     this.explanation  = mdoResult.Explanation;
 }
Exemple #2
0
    /// <summary>
    /// ノーツのタッチ結果によって演出を行う。
    /// </summary>
    /// <param name="note">タッチしたノーツ。</param>
    /// <param name="result">ノーツのタッチ結果。</param>
    void CreateTouchNoteEffect(Note note, NoteResult result)
    {
        // [Excellent > Good > Average > Miss]
        switch (result)
        {
        case NoteResult.Excellent:
            audioManager.PlaySE(SEName.Excellent.GetString());
            ShowEvalText("Excellent");
            break;

        case NoteResult.Good:
            audioManager.PlaySE(SEName.Good.GetString());
            ShowEvalText("Good");
            break;

        case NoteResult.Bad:
            ShowEvalText("Bad");
            break;

        case NoteResult.Miss:
            ShowEvalText("Miss");
            break;
        }
        Destroy(note.gameObject);
    }
Exemple #3
0
    /// <summary>
    /// ノーツのタッチ結果を元に、得点計算や画面へのエフェクト表示を行う。
    /// </summary>
    /// <param name="result">ノーツのタッチ結果。</param>
    /// <param name="note">タッチしたノーツ。</param>
    public void Determine(NoteResult result, Note note)
    {
        if (result == NoteResult.Unknown)
        {
            return;
        }

        scoreManager.CalcScore(result);
        CreateTouchNoteEffect(note, result);
        switch (result)
        {
        case NoteResult.Excellent:
        case NoteResult.Good:
            comboManager.AddCombo();
            break;

        case NoteResult.Bad:
            comboManager.ResetCombo();
            break;

        case NoteResult.Miss:
            AddLife(-1);
            comboManager.ResetCombo();
            break;
        }
    }
Exemple #4
0
    /// <summary>
    /// 得点を加算したスコアを計算する。
    /// </summary>
    /// <param name="result">ノーツをタップした結果。</param>
    public void CalcScore(NoteResult result)
    {
        ulong point = CalcAddedPoint(result);

        if (point != 0)
        {
            AddPoint(point);
        }
    }
Exemple #5
0
    /// <summary>
    /// 加算される得点を計算する。
    /// </summary>
    /// <param name="result">ノーツをタップした結果。</param>
    /// <returns>加算される得点。</returns>
    ulong CalcAddedPoint(NoteResult result)
    {
        ulong basePoint = 100;

        switch (result)
        {
        case NoteResult.Excellent:
            return(basePoint * 3);

        case NoteResult.Good:
            return(basePoint * 2);

        case NoteResult.Bad:
            return(basePoint);

        default:
            return(0);
        }
    }
    private IEnumerator RequestAtPos(LocationInfo location)
    {
        lastUpdate  = location;
        hasLocation = true;
        print("Making web request at " + location.ToString());
        using (UnityWebRequest www = UnityWebRequest.Get(API_ROOT + "/notes?lat=" + location.latitude + "&long="
                                                         + location.longitude + "&resolution=" + REQUEST_RESOLUTION_DEG)) {
            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                print("Failed to make request.");
                print(www.error);
                hasLocation = false;
            }
            else
            {
                print(www.downloadHandler.text);
                NoteResult result = JsonUtility.FromJson <NoteResult>(www.downloadHandler.text);
                print("Got " + result.notes.Length + " items.");
                onNotesUpdated.Invoke(result.notes, location);
            }
        }
    }
Exemple #7
0
        public NoteResultTO writeNote(
            string sitecode,
            string titleIEN,
            string encounterString,
            string text,
            string authorDUZ,
            string cosignerDUZ,
            string consultIEN,
            string prfIEN)
        {
            NoteResultTO result = new NoteResultTO();
            string       msg    = MdwsUtils.isAuthorizedConnection(_mySession, sitecode);

            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }
            else if (titleIEN == "")
            {
                result.fault = new FaultTO("Missing titleIEN");
            }
            else if (encounterString == "")
            {
                result.fault = new FaultTO("Missing encounterString");
            }
            else if (text == "")
            {
                result.fault = new FaultTO("No text!");
            }

            Encounter encounter = null;

            try
            {
                encounter = getFromEncounterString(encounterString);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            if (result.fault != null)
            {
                return(result);
            }

            // If no author DUZ we assume author is user
            if (authorDUZ == "")
            {
                authorDUZ = _mySession.User.Uid;
            }

            if (sitecode == null)
            {
                sitecode = _mySession.ConnectionSet.BaseSiteId;
            }

            // Externalizing note writing business rules...
            //Note note = new Note();
            //note.DocumentDefinitionId = titleIEN;
            //note.Author = new Author(authorDUZ, "", "");
            //note.Timestamp = DateTime.Now.ToString("yyyyMMdd");
            //note.ConsultId = consultIEN;
            //note.IsAddendum = false;
            //note.PrfId = prfIEN;

            //if (cosignerDUZ != "")
            //{
            //    note.Cosigner = new Author(cosignerDUZ, "", "");
            //}
            //note.Text = text;

            try
            {
                AbstractConnection cxn        = _mySession.ConnectionSet.getConnection(sitecode);
                NoteResult         noteResult = _api.writeNote(
                    cxn, titleIEN, encounter, text, authorDUZ, cosignerDUZ, consultIEN, prfIEN
                    );
                return(new NoteResultTO(noteResult));
            }
            catch (Exception e)
            {
                result.fault            = new FaultTO(e.Message);
                result.fault.stackTrace = e.StackTrace;
            }
            return(result);
        }
Exemple #8
0
        public NoteResult writeNote(Patient patient, User author, Note note, Encounter encounter, string sitecode)
        {
            mdo.sm.tiu.Patient p = new mdo.sm.tiu.Patient();

            DateTime trashDOB = new DateTime();

            if (DateTime.TryParse(patient.DOB, out trashDOB))
            {
                p.DateOfBirth = trashDOB;
            }
            Decimal trashDfn = new Decimal();

            if (Decimal.TryParse(patient.LocalPid, out trashDfn))
            {
                p.DFN = trashDfn;
            }
            p.FirstName = patient.Name.Firstname;
            p.LastName  = patient.Name.Lastname;
            p.ICN       = patient.MpiPid;
            Decimal trashSSN = new Decimal();

            if (Decimal.TryParse(patient.SSN.ToString(), out trashSSN))
            {
                p.SSN = trashSSN;
            }

            mdo.sm.tiu.Document n = new mdo.sm.tiu.Document();

            n.Author           = new mdo.sm.tiu.Staff();
            n.Author.DUZ       = 0;
            n.Author.FirstName = "";
            n.Author.LastName  = "";
            n.Author.SSN       = 0;

            DateTime trashNoteDateTime = new DateTime();

            if (DateTime.TryParse(note.Timestamp, out trashNoteDateTime))
            {
                n.DateTime = trashNoteDateTime;
            }
            n.NoteTitle = note.StandardTitle;
            n.Text      = note.Text;
            DateTime trashEncounterDateTime = new DateTime();

            if (DateTime.TryParse(encounter.Timestamp, out trashEncounterDateTime))
            {
                n.VisitDateTime = trashEncounterDateTime;
            }


            mdo.sm.tiu.AckType response = _svc.postNote(p, n, sitecode);

            // TODO - what is an expected response???
            if (String.IsNullOrEmpty(response.Status))
            {
            }

            NoteResult result = new NoteResult();

            result.Explanation = response.Status;
            return(result);
        }