/// <summary>
        /// Registers the genetic members.
        /// </summary>
        public static void RegisterGeneticMembers()
        {
            RegistrationManager.AddOperator(OperatorTypeEnum.And, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool);
            RegistrationManager.AddOperator(OperatorTypeEnum.Equal, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool);
            RegistrationManager.AddOperator(OperatorTypeEnum.Equal, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticGridDirection, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddOperator(OperatorTypeEnum.Equal, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticInt, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddOperator(OperatorTypeEnum.Minus, GeneticTypeEnum.GeneticInt, GeneticTypeEnum.GeneticInt, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddOperator(OperatorTypeEnum.NotEqual, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool);
            RegistrationManager.AddOperator(OperatorTypeEnum.NotEqual, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticGridDirection, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddOperator(OperatorTypeEnum.NotEqual, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticInt, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddOperator(OperatorTypeEnum.Or, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool);
            RegistrationManager.AddOperator(OperatorTypeEnum.Plus, GeneticTypeEnum.GeneticInt, GeneticTypeEnum.GeneticInt, GeneticTypeEnum.GeneticInt);

            RegistrationManager.AddReadOnlyVariable(EntVariableEnum.Health, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddReadOnlyVariable(EntVariableEnum.AttackStrength, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddReadOnlyVariable(EntVariableEnum.GrowFoodStrength, GeneticTypeEnum.GeneticInt);

            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperInt1, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperInt2, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperBool1, GeneticTypeEnum.GeneticBool);
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperBool2, GeneticTypeEnum.GeneticBool);
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperGridDirection1, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperGridDirection2, GeneticTypeEnum.GeneticGridDirection);

            RegistrationManager.AddLeftMethod(EntMethodEnum.Reproduce, GeneticTypeEnum.Void, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddLeftMethod(EntMethodEnum.Move, GeneticTypeEnum.Void, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddLeftMethod(EntMethodEnum.Attack, GeneticTypeEnum.Void, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddLeftMethod(EntMethodEnum.GrowFood, GeneticTypeEnum.Void);

            RegistrationManager.AddRightMethod(EntMethodEnum.DirectionIsOccupied, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddRightMethod(EntMethodEnum.DirectionIsEnemy, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddRightMethod(EntMethodEnum.DirectionIsFriend, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticGridDirection);
        }
Exemple #2
0
        /// <summary>
        /// Registers the genetic members.
        /// </summary>
        public static void RegisterGeneticMembers()
        {
            RegistrationManager.AddReadOnlyVariable(EntVariableEnum.Health, typeof(GeneticInt));
            RegistrationManager.AddReadOnlyVariable(EntVariableEnum.AttackStrength, typeof(GeneticInt));
            RegistrationManager.AddReadOnlyVariable(EntVariableEnum.GrowFoodStrength, typeof(GeneticInt));

            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperInt1, typeof(GeneticInt));
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperInt2, typeof(GeneticInt));
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperBool1, typeof(GeneticBool));
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperBool2, typeof(GeneticBool));
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperGridDirection1, typeof(GeneticGridDirection));
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperGridDirection2, typeof(GeneticGridDirection));

            RegistrationManager.AddLeftMethod(EntMethodEnum.Reproduce, typeof(void), typeof(GeneticGridDirection));
            RegistrationManager.AddLeftMethod(EntMethodEnum.Move, typeof(void), typeof(GeneticGridDirection));
            RegistrationManager.AddLeftMethod(EntMethodEnum.Attack, typeof(void), typeof(GeneticGridDirection));
            RegistrationManager.AddLeftMethod(EntMethodEnum.GrowFood, typeof(void));

            RegistrationManager.AddRightMethod(EntMethodEnum.DirectionIsOccupied, typeof(GeneticBool), typeof(GeneticGridDirection));
            RegistrationManager.AddRightMethod(EntMethodEnum.DirectionIsEnemy, typeof(GeneticBool), typeof(GeneticGridDirection));
            RegistrationManager.AddRightMethod(EntMethodEnum.DirectionIsFriend, typeof(GeneticBool), typeof(GeneticGridDirection));
        }