Example #1
0
 public Game(ModeTypes mode)
 {
     this.mode = mode;
     //TEST CODE DELETE AS SOON AS OBSOLETE
     CreatePlayer(PlayerTypes.Ghost, PlayerTypes.Human, ControllerTypes.Keyboard, new ControllerScheme(ControllerTypes.Keyboard));
     //END TEST CODE
 }
Example #2
0
 public Game(ModeTypes mode)
 {
     this.mode = mode;
     //TEST CODE DELETE AS SOON AS OBSOLETE
     CreatePlayer(PlayerTypes.Ghost, PlayerTypes.Human, ControllerTypes.Keyboard, new ControllerScheme(ControllerTypes.Keyboard));
     //END TEST CODE
 }
        public void fire_ModeChange(ModeTypes type, string title)
        {
            if (ModeChanges != null && type != null && title != null)
            {
                logModeChange(type, title);

                try
                {
                    ModeChanges.Invoke(this, new ModeEventArgs(type, title));
                }
                catch { }

                switch (type)
                {
                case ModeTypes.Start:
                    fire_ModeStarted(type, title);
                    break;

                case ModeTypes.Abort:
                    fire_ModeAborted(type, title);
                    break;

                case ModeTypes.Finish:
                    fire_ModeFinished(type, title);
                    break;

                default:
                    break;
                }
            }
        }
Example #4
0
    public static ArrayList CreateOrder(ModeTypes mode, ArrayList persons, 
			ArrayList comboSerie1Array, ArrayList comboSerie2Array, ArrayList comboSerie3Array)
    {
        ArrayList orderArray = new ArrayList(persons.Count);

        if(mode == ModeTypes.BY_PERSONS)
            foreach(Person p in persons)
                foreach(TrCombo tc in comboSerie1Array)
                    orderArray.Add(new ExecuteAuto(-1, p.UniqueID, p.Name, tc.id, tc.eName, tc.trName));
        else if(mode == ModeTypes.BY_TESTS)
            foreach(TrCombo tc in comboSerie1Array)
                foreach(Person p in persons)
                    orderArray.Add(new ExecuteAuto(-1, p.UniqueID, p.Name, tc.id, tc.eName, tc.trName));
        else {
            //by series
            foreach(Person p in persons)
                foreach(TrCombo tc in comboSerie1Array)
                    orderArray.Add(new ExecuteAuto(1, p.UniqueID, p.Name, tc.id, tc.eName, tc.trName));

            foreach(Person p in persons)
                foreach(TrCombo tc in comboSerie2Array)
                    orderArray.Add(new ExecuteAuto(2, p.UniqueID, p.Name, tc.id, tc.eName, tc.trName));

            foreach(Person p in persons)
                foreach(TrCombo tc in comboSerie3Array)
                    orderArray.Add(new ExecuteAuto(3, p.UniqueID, p.Name, tc.id, tc.eName, tc.trName));
        }

        return orderArray;
    }
 private void logModeChange(ModeTypes type, string Title)
 {
     if (type != null && Title != null)
     {
         Console.WriteLine("EditField_EventManager InputTypes:" + type.ToString() + " Text is: " + Title);
     }
 }
 /*handles internal mode changes and throws event*/
 private void modeInput(ModeTypes modeType)
 {
     if (modeType != null && Title != null && InputBox.BoxHeightType != null && InputBox.BoxHeightType != BoxHeightTypes.Unknown)
     {
         Title = InputManager.HandleModeChange(modeType, Title);
         EventManager.fire_ModeChange(modeType, Title);
     }
 }
Example #7
0
    public static ArrayList CreateOrder(ModeTypes mode, ArrayList persons,
                                        ArrayList comboSerie1Array, ArrayList comboSerie2Array, ArrayList comboSerie3Array)
    {
        ArrayList orderArray = new ArrayList(persons.Count);

        if (mode == ModeTypes.BY_PERSONS)
        {
            foreach (Person p in persons)
            {
                foreach (TrCombo tc in comboSerie1Array)
                {
                    orderArray.Add(new ExecuteAuto(-1, p.UniqueID, p.Name, tc.id, tc.eName, tc.trName));
                }
            }
        }
        else if (mode == ModeTypes.BY_TESTS)
        {
            foreach (TrCombo tc in comboSerie1Array)
            {
                foreach (Person p in persons)
                {
                    orderArray.Add(new ExecuteAuto(-1, p.UniqueID, p.Name, tc.id, tc.eName, tc.trName));
                }
            }
        }
        else
        {
            //by series
            foreach (Person p in persons)
            {
                foreach (TrCombo tc in comboSerie1Array)
                {
                    orderArray.Add(new ExecuteAuto(1, p.UniqueID, p.Name, tc.id, tc.eName, tc.trName));
                }
            }

            foreach (Person p in persons)
            {
                foreach (TrCombo tc in comboSerie2Array)
                {
                    orderArray.Add(new ExecuteAuto(2, p.UniqueID, p.Name, tc.id, tc.eName, tc.trName));
                }
            }

            foreach (Person p in persons)
            {
                foreach (TrCombo tc in comboSerie3Array)
                {
                    orderArray.Add(new ExecuteAuto(3, p.UniqueID, p.Name, tc.id, tc.eName, tc.trName));
                }
            }
        }

        return(orderArray);
    }
 private void fire_ModeAborted(ModeTypes type, string title)
 {
     if (ModeAborted != null)
     {
         try
         {
             ModeAborted.Invoke(this, new ModeEventArgs(type, title));
         }
         catch { }
     }
 }
Example #9
0
        public async Task <IActionResult> Register(ModeTypes ModeTypes)
        {
            var userWithSameEmail = _dbContext.ModeTypes.SingleOrDefault(u => u.ModeType == ModeTypes.ModeType);

            if (userWithSameEmail != null)
            {
                return(BadRequest("ModeType already exists"));
            }
            var ModeTypesObj = new ModeTypes
            {
                ModeType = ModeTypes.ModeType,
                ModeName = ModeTypes.ModeName
            };

            _dbContext.ModeTypes.Add(ModeTypesObj);
            await _dbContext.SaveChangesAsync();

            return(StatusCode(StatusCodes.Status201Created));
        }
        /// <summary>
        /// Registers for mode type event.
        /// </summary>
        /// <param name="d_event">The d_event.</param>
        /// <param name="type">The type.</param>
        public void RegisterForModeTypeEvent(EventHandler <ModeEventArgs> d_event, ModeTypes type)
        {
            if (d_event != null && type != null)
            {
                switch (type)
                {
                case ModeTypes.Start:
                    ModeStarted += d_event;
                    break;

                case ModeTypes.Abort:
                    ModeAborted += d_event;
                    break;

                case ModeTypes.Finish:
                    ModeFinished += d_event;
                    break;

                default:
                    break;
                }
            }
        }
        /// <summary>
        /// Handles the mode change.
        /// </summary>
        /// <param name="modeType">Type of the mode.</param>
        /// <param name="Title">The title.</param>
        /// <returns></returns>
        public string HandleModeChange(ModeTypes modeType, string Title)
        {
            if (modeType != null && Title != null)
            {
                switch (modeType)
                {
                case ModeTypes.Start:
                    startInput(Title);
                    break;

                case ModeTypes.Abort:
                    Title = abortInput(Title);
                    break;

                case ModeTypes.Finish:
                    Title = finishInput(Title);
                    break;

                default:
                    break;
                }
            }
            return(Title);
        }
 public static List <GameMode> GetGameModesOfType(ModeTypes type)
 {
     return(new List <GameMode>(gameModes.Where(G => G.ModeType == type)));
 }
 public ModeEventArgs(ModeTypes type, string title = "")
 {
     this.Type  = type;
     this.Title = title;
 }