コード例 #1
0
        public bool Contains(string key, GOAPState state)
        {
            if (!_states.ContainsKey(key))
            {
                return(false);
            }

            return(_states[key].Equals(state));
        }
コード例 #2
0
        public void Add(string key, GOAPState state)
        {
            if (!GOAPBlanksManager.Instance.Contains(key))
            {
                throw new Exception($"Нет элемента с ключом {key}");
            }

            if (GOAPBlanksManager.Instance.Blanks[key] != state.Type)
            {
                throw new Exception($"Нет элемента \"{key}\" с типом {state.Type}");
            }

            _states.Add(key, state);
        }
コード例 #3
0
        public bool Contains(string key, GOAPState state)
        {
            if (!_state.HasValue)
            {
                return(false);
            }

            if (_state.Value.Key != key)
            {
                return(false);
            }

            return(_state.Value.Value.Equals(state));
        }
コード例 #4
0
        public void Add(string key, object value)
        {
            var goapState = new GOAPState(value);

            Add(key, goapState);
        }
コード例 #5
0
 public void Set(string key, GOAPState state)
 {
     _states[key].SetValue(state);
 }
コード例 #6
0
 public void Set(string key, GOAPState state)
 {
     Set(new KeyValuePair <string, GOAPState>(key, state));
 }