예제 #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (DomesticStandingOrderId == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "DomesticStandingOrderId");
     }
     if (ConsentId == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ConsentId");
     }
     if (Initiation == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Initiation");
     }
     if (Charges != null)
     {
         foreach (var element in Charges)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (Initiation != null)
     {
         Initiation.Validate();
     }
     if (MultiAuthorisation != null)
     {
         MultiAuthorisation.Validate();
     }
 }
예제 #2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (ConsentId == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ConsentId");
     }
     if (Initiation == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Initiation");
     }
     if (Charges != null)
     {
         foreach (var element in Charges)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (ExchangeRateInformation != null)
     {
         ExchangeRateInformation.Validate();
     }
     if (Initiation != null)
     {
         Initiation.Validate();
     }
     if (Authorisation != null)
     {
         Authorisation.Validate();
     }
 }
    static Character characterCreation() //changed return type to Character to return object of Class Character
    {
        Console.WriteLine("Please enter your name: ");
        string name = Console.ReadLine();

        Console.WriteLine("\nWelcome " + name + "!");
        Console.WriteLine("Please select a class:\n1. Warrior - Bonus damage with melee weapons, average health.\n2. Ranger - Reduced health, bonus damage with ranged weapons.\n3. Paladin - Low damage, bonus to health and armor.");
        int cclass = Convert.ToInt32(Console.ReadLine());

        switch (cclass)
        {
        case 1:
            Console.WriteLine("You have chosen to be a Warrior, " + name + "!");
            break;

        case 2:
            Console.WriteLine("You have chosen to be a Ranger, " + name + "!");
            break;

        case 3:
            Console.WriteLine("You have chosen to be a Paladin, " + name + "!");
            break;

        default:
            Console.WriteLine("Incorrect entry, please enter 1, 2 or 3!");
            break;
        }
        var character = new Character();     //build up the return Object

        character.Name           = name;
        character.CharacterClass = cclass;
        character.Diff           = Initiation.difficultyMenu();
        return(character);
    }
예제 #4
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Initiation == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Initiation");
     }
     if (Initiation != null)
     {
         Initiation.Validate();
     }
     if (Authorisation != null)
     {
         Authorisation.Validate();
     }
 }
예제 #5
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            Initiation.ConfigureServices(services, Configuration.GetConnectionString("DefaultConnection"));

            var config = new AutoMapper.MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new AutoMapperProfile());
            });
            var mapper = config.CreateMapper();

            services.AddSingleton(mapper);

            services.AddAutoMapper();

            services.Configure <CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });


            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
        }
예제 #6
0
        private void Init_BloodEndInitiation(Initiation sender)
        {
            sender.EndInitiation -= Init_BloodEndInitiation;

            BloodLoad();
        }