public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id is null)
            {
                return(NotFound());
            }

            BookCopy = await _context.BookCopies.FirstOrDefaultAsync(m => m.Id == id);

            if (BookCopy is null)
            {
                return(NotFound());
            }

            var tempStates = BookStates.GetBookStates().Where(s => !_context.BookCopies.Any(x => x.BookId == BookCopy.BookId && x.State == s) || s == BookCopy.State).ToList();

            foreach (var item in tempStates)
            {
                AvailableStates.Add(new SelectListItem {
                    Value = item, Text = item
                });
            }

            return(Page());
        }
        private void DetermineAvailableCombatStates(OTGCombatSMC _selectedCombatant)
        {
            AvailableStates.Add((OTGCombatState)SObj_InitialState.targetObject);
            SerializedProperty transitions = SObj_InitialState.FindProperty("m_stateTransitions");

            GetStatesFromTransition(transitions);
        }
 //setup
 private void InstantiateStates()
 {
     AvailableStates.Add(typeof(UpAndActive), new UpAndActive(this));
     AvailableStates.Add(typeof(AirBorne), new AirBorne(this));
     AvailableStates.Add(typeof(Tripping), new Tripping(this, GetComponent <Collider2D>()));
     AvailableStates.Add(typeof(StateClasses.Ratbag.GameplayStates.Floored), new StateClasses.Ratbag.GameplayStates.Floored(this));
     AvailableStates.Add(typeof(GettingUp), new GettingUp(this));
     AvailableStates.Add(typeof(Spawning), new Spawning(this));
 }
Exemplo n.º 4
0
        public void RemoveResetState(string state)
        {
            if (state == null)
            {
                return;
            }

            AvailableStates.Add(state);
            ResetStates.Remove(state);
            _statesRepository.SetResetStates(ResetStates.ToArray());
        }
Exemplo n.º 5
0
        public void RemoveFilteredState(string state)
        {
            if (state == null)
            {
                return;
            }

            AvailableStates.Add(state);
            FilteredStates.Remove(state);
            _statesRepository.SetFilteredStates(FilteredStates.ToArray());
        }
        private void GetStatesFromTransition(SerializedProperty _currentTransitions)
        {
            if (_currentTransitions == null || _currentTransitions.arraySize == 0)
            {
                return;
            }

            int amountOfTransitions = _currentTransitions.arraySize;

            for (int i = 0; i < amountOfTransitions; i++)
            {
                SerializedProperty nextStateProp = _currentTransitions.GetArrayElementAtIndex(i).FindPropertyRelative("m_nextState");
                OTGCombatState     nextState     = (OTGCombatState)nextStateProp.objectReferenceValue;
                if (nextState != null && !AvailableStates.Contains(nextState))
                {
                    SerializedObject stateSOBJ = new SerializedObject(nextState);
                    GetStatesFromTransition(stateSOBJ.FindProperty("m_stateTransitions"));
                    AvailableStates.Add(nextState);
                }
            }
        }