Esempio n. 1
0
        public override bool Match(Agent agent, OutputChange outputChange, MappingType outputChangeMappingType,
                                   InputCondition inputCondition, MappingType inputConditionMappingType)
        {
            List <InputCondition> inputConditionsFromOC = outputChangeMappingType.EntityTypeInputConditions();
            List <EntityType>     entityTypes           = TypeGroup.PossibleEntityTypes(inputConditionsFromOC, agent.memoryType.GetKnownEntityTypes(agent));

            if (inputConditionMappingType.AnyEntityTypeMatchesTypeGroups(entityTypes) &&
                inputCondition.levelType == outputChange.levelType)
            {
                // Same EntityType and same TagType - match adding tag to needing tag and removing tag to can't have tag
                if (!outputChange.boolValue &&
                    ((HasTagICT.Scope)inputCondition.enumValueIndex == HasTagICT.Scope.DoesNotHaveOwnerTag ||
                     (HasTagICT.Scope)inputCondition.enumValueIndex == HasTagICT.Scope.DoesNotHaveTag))
                {
                    return(true);
                }
                else if (outputChange.boolValue &&
                         ((HasTagICT.Scope)inputCondition.enumValueIndex == HasTagICT.Scope.HasTagButNotOwner ||
                          (HasTagICT.Scope)inputCondition.enumValueIndex == HasTagICT.Scope.HasTagIgnoreOwnership ||
                          (HasTagICT.Scope)inputCondition.enumValueIndex == HasTagICT.Scope.HasTagIsOwner))
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 2
0
        public override bool Match(Agent agent, OutputChange outputChange, MappingType outputChangeMappingType,
                                   InputCondition inputCondition, MappingType inputConditionMappingType)
        {
            List <InputCondition> inputConditionsFromOC = outputChangeMappingType.EntityTypeInputConditions();
            List <EntityType>     entityTypes           = TypeGroup.PossibleEntityTypes(inputConditionsFromOC, agent.memoryType.GetKnownEntityTypes(agent));

            if (inputConditionMappingType.AnyEntityTypeMatchesTypeGroups(entityTypes))
            {
                return(true);
            }
            return(false);
        }
Esempio n. 3
0
        public override bool Match(Agent agent, OutputChange outputChange, MappingType outputChangeMappingType,
                                   InputCondition inputCondition, MappingType inputConditionMappingType)
        {
            // This matches WorldObjectStateICT
            List <InputCondition> inputConditionsFromOC = outputChangeMappingType.EntityTypeInputConditions();
            List <EntityType>     entityTypes           = TypeGroup.PossibleEntityTypes(inputConditionsFromOC, agent.memoryType.GetKnownEntityTypes(agent));

            if (inputConditionMappingType.AnyEntityTypeMatchesTypeGroups(entityTypes) &&
                outputChange.stringValue == inputCondition.stringValue)
            {
                return(true);
            }
            return(false);
        }