예제 #1
0
        private void frmScheduleDoctor_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'scheduleMeeting.MyMeetingDoctor' table. You can move, or remove it, as needed.
            this.myMeetingDoctorTableAdapter.Fill(this.scheduleMeeting.MyMeetingDoctor);
            // TODO: This line of code loads data into the 'scedule.MeetingDoctor' table. You can move, or remove it, as needed.
            // TODO: This line of code loads data into the 'hMODataSet1.MeetingDoctor' table. You can move, or remove it, as needed.
            //this.meetingDoctorTableAdapter.Fill(this.hMODataSet1.MeetingDoctor);
            string firstTherapyCode = textBox1.Text;

            while (!doctorId.Equals(textBox2.Text))
            {
                meetings.MoveNext();
                Populate(meetings.GetCurrentRow());
                if (firstTherapyCode.Equals(textBox1.Text))
                {
                    Clear();
                    textBox1.Text = meetings.GetKey();
                    textBox2.Text = doctorId;
                    state         = AddState.ADDNEW;
                    SetButtonStates(false);
                    cancel.Enabled = false;
                    label6.Visible = true;
                    return;
                }
            }
        }
예제 #2
0
파일: ReviveActor.cs 프로젝트: Mixi59/Stump
        void ReviveActor(FightActor actor, int heal)
        {
            var cell = TargetedCell;

            if (!Fight.IsCellFree(cell))
            {
                cell = Map.GetRandomAdjacentFreeCell(TargetedPoint, true);
            }

            actor.Revive(heal, Caster);
            actor.SummoningEffect = this;
            actor.Position.Cell   = cell;
            actor.BuffRemoved    += OnBuffRemoved;

            if (Spell.Id == (int)SpellIdEnum.LAISSE_SPIRITUELLE_420)
            {
                var actorBuffId = actor.PopNextBuffId();

                var addStateHandler = new AddState(new EffectDice(EffectsEnum.Effect_AddState, (short)SpellStatesEnum.ZOMBI_74, 0, 0), actor, null, actor.Cell, false);
                var actorBuff       = new StateBuff(actorBuffId, actor, Caster, addStateHandler,
                                                    Spell, FightDispellableEnum.DISPELLABLE_BY_DEATH, SpellManager.Instance.GetSpellState((uint)SpellStatesEnum.ZOMBI_74))
                {
                    Duration = -1000
                };

                actor.AddBuff(actorBuff, true);
            }

            ActionsHandler.SendGameActionFightReviveMessage(Fight.Clients, Caster, actor);
            ContextHandler.SendGameFightTurnListMessage(Fight.Clients, Fight);
        }
예제 #3
0
        public static async Task Take_AtThread_2(Adapter_ProducerConsumer <TItem> buffer, HashSet <TItem> addSerial)
        {
            Assert.IsTrue(buffer.Count == 0);

            TItem first  = addSerial.ElementAt(0);
            TItem second = addSerial.ElementAt(1);

            AddState <TItem> addState_First  = new AddState <TItem>(buffer, first);
            AddState <TItem> addState_Second = new AddState <TItem>(buffer, second);

            Timer timerReaction_First  = new Timer(TimeOut_AddAction, addState_First, DelayWait, Timeout.Infinite);
            Timer timerReaction_Second = new Timer(TimeOut_AddAction, addState_Second, DelayWaitDouble, Timeout.Infinite);

            ResultDouble <TItem> result = await buffer.Take_AtThread_2();

            Assert.IsTrue(buffer.Count == 0);

            if (result.Value_1.Equals(first))
            {
                Assert.IsTrue(result.Value_2.Equals(second));
            }
            else
            {
                Assert.IsTrue(result.Value_1.Equals(second));
                Assert.IsTrue(result.Value_2.Equals(first));
            }
        }
예제 #4
0
 private void save_Click(object sender, EventArgs e)
 {
     try
     {
         Patient p = new Patient();
         if (UpdateObject(p))
         {
             if (state == AddState.ADDNEW)
             {
                 patients.AddRow(p);
             }
             else
             {
                 patients.UpdateRow(p);
             }
         }
         SetButtonStates(true);
         state = AddState.NAVIGATE;
         patients.Save();
     }
     catch
     {
         MyMessage m = new MyMessage("the patient is already exist in the database", 2);
         m.applyCustomChange();
         m.ShowDialog();
     }
 }
예제 #5
0
 private void Add_Click(object sender, EventArgs e)
 {
     Clear();
     inputId.Text = departments.GetKey();
     state        = AddState.ADDNEW;
     SetButtonStates(false);
 }
예제 #6
0
 private void save_Click(object sender, EventArgs e)
 {
     try
     {
         Department d = new Department();
         if (UpdateObject(d))
         {
             if (state == AddState.ADDNEW)
             {
                 departments.AddRow(d);
             }
             else
             {
                 departments.UpdateRow(d);
             }
         }
         SetButtonStates(true);
         state = AddState.NAVIGATE;
         departments.Save();
     }
     catch
     {
         MyMessage m = new MyMessage("the department is already exist", 2);
         m.applyCustomChange();
         m.ShowDialog();
     }
 }
예제 #7
0
 private void save_Click(object sender, EventArgs e)
 {
     try
     {
         DoctorOrNurse dn = new DoctorOrNurse();
         if (UpdateObject(dn))
         {
             if (state == AddState.ADDNEW)
             {
                 doctorsOrNurses.AddRow(dn);
             }
             else
             {
                 doctorsOrNurses.UpdateRow(dn);
             }
         }
         SetButtonStates(true);
         state = AddState.NAVIGATE;
         doctorsOrNurses.Save();
     }
     catch
     {
         MyMessage m = new MyMessage("this worker is already exist in the department", 2);
         m.applyCustomChange();
         m.ShowDialog();
     }
 }
예제 #8
0
 private void Add_Click(object sender, EventArgs e)
 {
     Clear();
     textBox1.Text = meetings.GetKey();
     textBox2.Text = this.doctorId;
     state         = AddState.ADDNEW;
     SetButtonStates(false);
 }
예제 #9
0
 public frmDoctorOrNurse(Form f)
 {
     this.parent = f;
     InitializeComponent();
     doctorsOrNurses = new DoctorOrNurseDB();
     state           = AddState.NAVIGATE;
     Populate(doctorsOrNurses.GetCurrentRow());
     SetButtonStates(true);
 }
예제 #10
0
 public frmDepartment(Form frmmain)
 {
     this.parent = frmmain;
     InitializeComponent();
     departments = new DepartmentDB();
     state       = AddState.NAVIGATE;
     Populate(departments.GetCurrentRow());
     SetButtonStates(true);
 }
예제 #11
0
 public void OnEnable()
 {
     m_chaEditData = target as CharacterEditorData;
     if (m_chaEditData == null)
     {
         return;
     }
     m_addState = AddState.NONE;
 }
예제 #12
0
 public frmScheduleDoctor(string doctorId)
 {
     this.doctorId = doctorId;
     InitializeComponent();
     meetings = new ScheduleDoctorMeetingDB();
     Populate(meetings.GetCurrentRow());
     state = AddState.NAVIGATE;
     SetButtonStates(true);
 }
예제 #13
0
    // Use this for initialization
    void Start()
    {
        counter = new Counter();
        AddState      addState      = new AddState(counter);
        MultiplyState multiplyState = new MultiplyState(counter);

        fsm = new FiniteStateMachine <States>(addState);
        fsm.AddTransition(new ITransition <States>(States.ADD, States.MULTIPLY), multiplyState);
        fsm.AddTransition(new ITransition <States>(States.MULTIPLY, States.ADD), addState);
    }
예제 #14
0
 public frmDoctorOrNurse(string id)
 {
     InitializeComponent();
     this.idDoc      = id;
     doctorsOrNurses = new DoctorOrNurseDB();
     state           = AddState.NAVIGATE;
     SetButtonStates(true);
     doctorsOrNurses.Find(id);
     Populate(doctorsOrNurses.GetCurrentRow());
     flag = true;
 }
예제 #15
0
        public int AddState(AddState addState)
        {
            int result = 0;

            using (TestingSample1Entities testingSample1Entities = new TestingSample1Entities())
            {
                ObjectParameter opResult = new ObjectParameter("Result", typeof(int));
                testingSample1Entities.StateAdd(addState.StateName, addState.CountryId, opResult);
                result = Convert.ToInt32(opResult.Value);
            }
            return(result);
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            removeAllManagamentControls();

            switch (this.Mantenimiento)
            {
            case "Users":
                AddUser addUser = new AddUser();
                Parent.Controls.Add(addUser);
                break;

            case "Clients":
                AddClient addClient = new AddClient();
                Parent.Controls.Add(addClient);
                break;

            case "States":
                AddState addState = new AddState();
                Parent.Controls.Add(addState);
                break;

            case "PaymentMethods":
                AddPaymentMethod deletePayment = new AddPaymentMethod();
                Parent.Controls.Add(deletePayment);
                break;

            case "MaterialTypes":
                AddMaterialType addMaterialType = new AddMaterialType();
                Parent.Controls.Add(addMaterialType);
                break;

            case "Materials":
                AddMaterial addMaterial = new AddMaterial();
                Parent.Controls.Add(addMaterial);
                break;

            case "ProductTypes":
                AddProductType addProductType = new AddProductType();
                Parent.Controls.Add(addProductType);
                break;

            case "Products":
                AddProduct addProduct = new AddProduct();
                Parent.Controls.Add(addProduct);
                break;

            case "Providers":
                AddProvider addP = new AddProvider();
                Parent.Controls.Add(addP);
                break;
            }
        }
예제 #17
0
        //public frmPatient()
        //{
        //    InitializeComponent();
        //    patients = new PatientDB();
        //    state = AddState.NAVIGATE;
        //    Populate(patients.GetCurrentRow());
        //    SetButtonStates(true);
        //}

        public frmPatient(Form frmmain)
        {
            this.parent = frmmain;
            InitializeComponent();
            patients = new PatientDB();
            state    = AddState.NAVIGATE;
            Populate(patients.GetCurrentRow());
            SetButtonStates(true);
            dv = patients.GetDataView();
            listBox1.DataSource    = dv;
            listBox1.ValueMember   = "ID";
            listBox1.DisplayMember = "LastName";
        }
예제 #18
0
        public ActionResult Create(AddState addState)
        {
            int result = 0;

            try
            {
                result = iState.AddState(addState);
            }
            catch (Exception)
            {
                result = -1;
            }
            return(Json(result));
        }
예제 #19
0
        public static async Task Take_LessDownBound(Adapter_ProducerConsumer <TItem> buffer, HashSet <TItem> addSerial)
        {
            Assert.IsTrue(buffer.Count == 0);

            TItem first = addSerial.First();

            AddState <TItem> addState = new AddState <TItem>(buffer, first);

            Timer timerReactionNormal = new Timer(TimeOut_AddAction, addState, DelayWait, Timeout.Infinite);
            TItem taked = await buffer.Take_AtTask();

            Assert.IsTrue(buffer.Count == 0);
            Assert.IsTrue(taked.Equals(first));
        }
예제 #20
0
        private void save_Click(object sender, EventArgs e)
        {
            try
            {
                ScheduleDoctorMeeting s = new ScheduleDoctorMeeting();
                //s.Day = comboBox1.SelectedIndex + 1;
                if (UpdateObject(s))
                {
                    if (state == AddState.ADDNEW)
                    {
                        //string SQLadd = "INSERT INTO MeetingDoctor ( TherapyCode, WhoCanGiveTheTherapy, IdDoctor, [day], [hour] ) VALUES('" + s.TherapyCode + "','" + s.WhoCanGiveTheTherapy + "','" + s.IdDoctor + "',[" + s.Day + "],['" + s.Hour + "'])";
                        //string path = System.IO.Directory.GetCurrentDirectory();
                        //int x = path.IndexOf("\\bin");
                        //path = path.Substring(0, x) + "\\Data\\try.accdb";

                        //string myConnectionStr = (@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + path + "';Persist Security Info=True");
                        //con = new OleDbConnection(myConnectionStr);
                        //con.Open();
                        //OleDbCommand SQLCommand = new OleDbCommand();
                        //SQLCommand.CommandText = SQLadd;
                        //SQLCommand.Connection = con;
                        //int response1 = -1;
                        //  response1 = SQLCommand.ExecuteNonQuery();
                        //response1 = DAL.GetInstance().ExecuteNonQuery(SQLadd);
                        myMeetingDoctorTableAdapter.MyInsert(s.TherapyCode, s.WhoCanGiveTheTherapy, s.IdDoctor, s.Day, s.Hour);
                    }
                    else
                    {
                        ScheduleDoctorMeeting orginal = meetings.GetCurrentRow();
                        myMeetingDoctorTableAdapter.MyUpdate(s.WhoCanGiveTheTherapy, s.IdDoctor, s.Day, s.Hour, orginal.TherapyCode);
                    }
                }
                SetButtonStates(true);
                state = AddState.NAVIGATE;
                //..           meetings.Save();
                label6.Visible = false;
            }
            catch
            {
                MyMessage m = new MyMessage("the data is already exist in the database", 2);
                m.applyCustomChange();
                m.ShowDialog();
            }
        }
예제 #21
0
    /// <summary>
    /// Plays an audio clip in the music audio source.
    /// </summary>
    /// <param name="clipIndex">The index of the clip to play</param>
    /// <param name="addState">DontReplace: If a clip is already playing, don't do anything.<br></br>Replace: Always play the clip.<br></br>Queue: If a clip is already playing, play it once the clip has stopped playing.</param>
    /// <param name="maxVolume">The maximum volume the clip will ever reach</param>
    /// <param name="loop">Whether the clip should be looped</param>
    /// <param name="fadeInSpeed">Speed at which to fade-in. 1 = instantaneous</param>
    /// <param name="fadeOutSpeed">Speed at which to fade-out the previous clip (if AddState.Queue). 1 = instantaneous</param>
    public void PlayClip(string audioClipId, AddState addState, float maxVolume = 1f, bool loop = false, float fadeInSpeed = 1f, float fadeOutSpeed = 1f)
    {
        if (!musicAudioSource.isPlaying || addState == AddState.Replace)
        {
            musicAudioSource.clip = AudioDatabase.GetClip(audioClipId);
            StartFadeIn(fadeInSpeed, maxVolume);
            musicAudioSource.loop = loop;
        }
        else if (addState == AddState.Queue)
        {
            if (currentQueueWait != null)
            {
                StopCoroutine(currentQueueWait);
            }

            StartFadeOut(fadeOutSpeed);
            currentQueueWait = StartCoroutine(WaitForStop(audioClipId, maxVolume, loop, fadeInSpeed));
        }
    }
예제 #22
0
 private void Add_Click(object sender, EventArgs e)
 {
     Clear();
     state = AddState.ADDNEW;
     SetButtonStates(false);
 }
예제 #23
0
 private void update_Click(object sender, EventArgs e)
 {
     SetButtonStates(false);
     state = AddState.UPDATE;
 }
예제 #24
0
    public override void OnInspectorGUI()
    {
        if (m_chaEditData == null)
        {
            PrintLog("the chaEditorData is null");
            return;
        }
        m_chaEditData.m_id              = EditorGUILayout.IntField("PlayerID: ", m_chaEditData.m_id);
        m_chaEditData.m_resID           = EditorGUILayout.IntField("PlayerResourceID:", m_chaEditData.m_resID);
        m_chaEditData.m_defaultName     = EditorGUILayout.TextField("PlayerDefaultName: ", m_chaEditData.m_defaultName);
        m_chaEditData.m_scale           = EditorGUILayout.FloatField("PlayerScale:", m_chaEditData.m_scale);
        m_chaEditData.m_walkSpeedX      = EditorGUILayout.IntField("PlayerXSpeed: ", m_chaEditData.m_walkSpeedX);
        m_chaEditData.m_walkSpeedY      = EditorGUILayout.IntField("PlayerYSpeed:", m_chaEditData.m_walkSpeedY);
        m_chaEditData.m_hatred          = EditorGUILayout.FloatField("PlayerHatred:", m_chaEditData.m_hatred);
        m_chaEditData.m_lowFireAngle    = EditorGUILayout.FloatField("PlayerLowFireAngle:", m_chaEditData.m_lowFireAngle);
        m_chaEditData.m_higFireAngle    = EditorGUILayout.FloatField("PlayerHigFireAngle:", m_chaEditData.m_higFireAngle);
        m_chaEditData.m_fireRange       = EditorGUILayout.IntField("PlayerFireRange:", m_chaEditData.m_fireRange);
        m_chaEditData.m_weaponPosition  = EditorGUILayout.Vector2Field("PlayerWeaponPos", m_chaEditData.m_weaponPosition);
        m_chaEditData.m_beAttackBoxMinX = EditorGUILayout.IntField("PlayerBAtkBoxMinX:", m_chaEditData.m_beAttackBoxMinX);
        m_chaEditData.m_beAttackBoxMinY = EditorGUILayout.IntField("PlayerBAtkBoxMinY:", m_chaEditData.m_beAttackBoxMinY);
        m_chaEditData.m_beAttackBoxMaxX = EditorGUILayout.IntField("PlayerBAtkBoxMaxX:", m_chaEditData.m_beAttackBoxMaxX);
        m_chaEditData.m_beAttackBoxMaxY = EditorGUILayout.IntField("PlayerBAtkBoxMaxY:", m_chaEditData.m_beAttackBoxMaxY);
        if (GUILayout.Button("Add New State"))
        {
            if (m_chaEditData.IsAllStateExist())
            {
                m_addState = AddState.FULLSTATE;
            }
            else
            {
                m_addState = AddState.NEWSTATE;
            }
        }
        EditorGUILayout.Space();
        if (m_addState == AddState.FULLSTATE)
        {
            EditorGUILayout.LabelField("all states is used");
        }
        else if (m_addState == AddState.NEWSTATE)
        {
            CharacterStateType newestState = m_chaEditData.GetNewestState();
            m_chaEditData.AddNewState(newestState);
            m_addState = AddState.NONE;
        }

        EditorGUILayout.Space();
        ///Debug.Log("yes");
        for (int index = 0; index < m_chaEditData.m_lsStates.Count; index++)
        {
            CharacterEditorData.CharacterEditorStateData chaState = m_chaEditData.m_lsStates[index];
            //Debug.Log(EditorGUILayout.EnumPopup("state:", chaState.m_newState));
            CharacterStateType state = (CharacterStateType)EditorGUILayout.EnumPopup("state:", chaState.m_stateType);
            m_chaEditData.ChangeByState(chaState, state);
            chaState.m_animationName = EditorGUILayout.TextField("AnimationName:", chaState.m_animationName);
            int totFrame = EditorGUILayout.IntField("TotalFrame:", chaState.m_totFrame);
            if (totFrame != chaState.m_totFrame)
            {
                chaState.m_totFrame = totFrame;
                chaState.UpdateFramesSz();
            }
            if (chaState.m_stateType == CharacterStateType.ATTACK)
            {
                if (GUILayout.Button("Add Frame Data", GUILayout.MaxWidth(130), GUILayout.MaxHeight(20)))
                {
                    int newFrame = chaState.GetNewFrame();
                    //Debug.Log(newFrame);
                    if (newFrame != -1)
                    {
                        chaState.AddFrameData(newFrame);
                    }
                }
                EditorGUILayout.Space();
                for (int i = 0; i < chaState.m_attackDatas.Count; i++)
                {
                    CharacterEditorData.CharacterEditorAttackData frameData = chaState.m_attackDatas[i];
                    int frame = EditorGUILayout.IntField("Frame:", frameData.m_iFrame);
                    if (chaState.IsLegalFrame(frame))
                    {
                        //Debug.Log(frame);
                        frameData.m_iFrame = frame;
                    }
                    CharacterAttackType attackType = (CharacterAttackType)EditorGUILayout.EnumPopup("AttackType:", frameData.m_attackType);
                    chaState.ChangeFrameData(i, attackType);
                    EditorGUILayout.Space();
                    if (frameData.m_attackType == CharacterAttackType.BOMB)
                    {
                        CharacterEditorData.CharacterEditorBombAttackData bomb = (CharacterEditorData.CharacterEditorBombAttackData)frameData;
                        bomb.m_bombCofigID  = EditorGUILayout.IntField("BombConfigID:", bomb.m_bombCofigID);
                        bomb.m_damage       = EditorGUILayout.IntField("Damge:", bomb.m_damage);
                        bomb.m_centerDamage = EditorGUILayout.IntField("CenterDamage:", bomb.m_centerDamage);
                    }
                    if (GUILayout.Button("Remove this Frame"))
                    {
                        chaState.RemoveFrameData(frameData.m_iFrame);
                    }
                    EditorGUILayout.Space();
                    EditorGUILayout.Space();
                }
            }
            if (GUILayout.Button("remove this state"))
            {
                m_chaEditData.RemoveOldState(index);
            }
            EditorGUILayout.Space();
            EditorGUILayout.Space();
        }
        EditorUtility.SetDirty(m_chaEditData);
    }
예제 #25
0
        private static void TimeOut_AddAction(Object state)
        {
            AddState <TItem> addState = state as AddState <TItem>;

            addState.Add();
        }
예제 #26
0
 protected virtual void OnAddState(AGameState newState)
 {
     AddState?.Invoke(this, newState);
 }