Пример #1
0
        public void SetField(string fieldName, object value)
        {
            switch (fieldName)
            {
            case nameof(Left):
                Left = (Unity.AI.Planner.DomainLanguage.TraitBased.TraitBasedObjectId)value;
                break;

            case nameof(Right):
                Right = (Unity.AI.Planner.DomainLanguage.TraitBased.TraitBasedObjectId)value;
                break;

            case nameof(Up):
                Up = (Unity.AI.Planner.DomainLanguage.TraitBased.TraitBasedObjectId)value;
                break;

            case nameof(Down):
                Down = (Unity.AI.Planner.DomainLanguage.TraitBased.TraitBasedObjectId)value;
                break;

            case nameof(Occupied):
                Occupied = (System.Boolean)value;
                break;

            case nameof(Visited):
                Visited = (System.Int64)value;
                break;

            default:
                throw new ArgumentException($"Field \"{fieldName}\" does not exist on trait Waypoint.");
            }
        }
Пример #2
0
        public void SetField(string fieldName, object value)
        {
            switch (fieldName)
            {
            case nameof(Type):
                Type = (AI.Planner.Domains.Enums.CellType)Enum.ToObject(typeof(AI.Planner.Domains.Enums.CellType), value);
                break;

            case nameof(Left):
                Left = (Unity.AI.Planner.DomainLanguage.TraitBased.TraitBasedObjectId)value;
                break;

            case nameof(Right):
                Right = (Unity.AI.Planner.DomainLanguage.TraitBased.TraitBasedObjectId)value;
                break;

            case nameof(Top):
                Top = (Unity.AI.Planner.DomainLanguage.TraitBased.TraitBasedObjectId)value;
                break;

            case nameof(Bottom):
                Bottom = (Unity.AI.Planner.DomainLanguage.TraitBased.TraitBasedObjectId)value;
                break;

            default:
                throw new ArgumentException($"Field \"{fieldName}\" does not exist on trait Cell.");
            }
        }
Пример #3
0
        public void SetField(string fieldName, object value)
        {
            switch (fieldName)
            {
            case nameof(CarriedBy):
                CarriedBy = (Unity.AI.Planner.DomainLanguage.TraitBased.TraitBasedObjectId)value;
                break;

            default:
                throw new ArgumentException($"Field \"{fieldName}\" does not exist on trait Carriable.");
            }
        }
Пример #4
0
        public void SetField(string fieldName, object value)
        {
            switch (fieldName)
            {
            case nameof(Waypoint):
                Waypoint = (Unity.AI.Planner.DomainLanguage.TraitBased.TraitBasedObjectId)value;
                break;

            case nameof(ID):
                ID = (System.Int64)value;
                break;

            default:
                throw new ArgumentException($"Field \"{fieldName}\" does not exist on trait Character.");
            }
        }