Ejemplo n.º 1
0
        public IHttpActionResult PutRequirementDescription(int id, RequirementDescription requirementDescription)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != requirementDescription.ID)
            {
                return(BadRequest());
            }

            db.Entry(requirementDescription).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RequirementDescriptionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 2
0
 public void UpdateRequirementDescription(RequirementId requirementId, RequirementDescription description)
 {
     Apply(new RequirementEvents.DescriptionChanged
     {
         Id          = requirementId,
         Description = description
     });
 }
Ejemplo n.º 3
0
        public IHttpActionResult GetRequirementDescription(int id)
        {
            RequirementDescription requirementDescription = db.RequirementDescriptions.Find(id);

            if (requirementDescription == null)
            {
                return(NotFound());
            }

            return(Ok(requirementDescription));
        }
Ejemplo n.º 4
0
    public TavernKeeperQuest()
    {
        ID          = "TavernKeeperQuest";
        Name        = "Help the tavern keeper restock his meat";
        Description = "Hunt wolves for 10 meat and give it to the tavern keeper.";
        RequirementDescription.Add("The tavern is out of meat. He needs 10 to satisfy his customers. Meat comes from wolves");

        ItemRequirements.Add(new ItemSaveName("Meat", 10));
        TakeItemRequirements = true;
        InitializeGoals();
    }
Ejemplo n.º 5
0
 public void AddRequirement(RequirementName name, RequirementDescription description, RequirementExample example)
 {
     Apply(new RequirementEvents.AddedToVisa
     {
         RequirementId = Guid.NewGuid(),
         VisaId        = Id,
         Name          = name,
         Description   = description,
         Example       = example
     });
 }
Ejemplo n.º 6
0
        public IHttpActionResult PostRequirementDescription(RequirementDescription requirementDescription)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.RequirementDescriptions.Add(requirementDescription);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = requirementDescription.ID }, requirementDescription));
        }
Ejemplo n.º 7
0
    public QuestFur()
    {
        ID          = "QuestFur";
        Name        = "Fur Quest";
        Description = "Help Cassida Smith aquire some fur from the North in the Hunting Grounds.";
        RequirementDescription.Add("Aquire 5 furs");

        // DialogueRequirements.Add("QuestStatus", "accepted_incomplete");
        ItemRequirements.Add(new ItemSaveName("Fur", 5));
        TakeItemRequirements = true;
        InitializeGoals();
    }
Ejemplo n.º 8
0
    public QuestDragonHide()
    {
        ID          = "QuestDragonHide";
        Name        = "Dragon Hide Quest";
        Description = "Help Cassida Smith aquire some dragons hide from the North in the Hunting Grounds.";
        RequirementDescription.Add("Aquire 5 dragon hides");

        // DialogueRequirements.Add("QuestStatus", "accepted_incomplete");
        ItemRequirements.Add(new ItemSaveName("Dragon Hide", 5));
        TakeItemRequirements = true;
        InitializeGoals();
    }
Ejemplo n.º 9
0
        public IHttpActionResult DeleteRequirementDescription(int id)
        {
            RequirementDescription requirementDescription = db.RequirementDescriptions.Find(id);

            if (requirementDescription == null)
            {
                return(NotFound());
            }

            db.RequirementDescriptions.Remove(requirementDescription);
            db.SaveChanges();

            return(Ok(requirementDescription));
        }
Ejemplo n.º 10
0
            public void ThrowException_ValidRequirementButExpectedProcessingTimeNotSet()
            {
                // Arrange
                const VisaType type                   = VisaType.D;
                var            visa                   = new Visa(type);
                var            requirementName        = RequirementName.FromString("Invitation Letter");
                var            requirementDescription =
                    RequirementDescription.FromString("A letter of acceptance from a foreign university.");
                var requirementExample = RequirementExample.FromString("acceptance_letter_example.png");

                // Act & Assert
                Assert.Throws <Exceptions.InvalidEntityState>(() =>
                                                              visa.AddRequirement(requirementName, requirementDescription, requirementExample));
            }
Ejemplo n.º 11
0
    public ThorinIntroQuest()
    {
        ID          = "ThorinIntroQuest";
        Name        = "Magic Staff Practice";
        Description = "Thorin asked you to test out the magical staff he gave you on a campfire. After you do you should talk to him again.";
        RequirementDescription.Add("Aquire 1 torch");
        TakeItemRequirements = false;

        // Check if you have talked to thorin
        // DialogueRequirements.Add("ThorinIntroQuest", "accepted_incomplete");
        // Checks if you have the staff thorin will give you
        // ItemRequirements.Add(new ItemSaveName("Basic Staff", 1));
        // Checks if you have the torch
        ItemRequirements.Add(new ItemSaveName("Torch", 1));

        InitializeGoals();
    }
Ejemplo n.º 12
0
            public void AddRequirement_ValidRequirementAndExpectedProcessingTimeSet()
            {
                // Arrange
                const VisaType type                   = VisaType.D;
                var            visa                   = new Visa(type);
                var            requirementName        = RequirementName.FromString("Invitation Letter");
                var            requirementDescription =
                    RequirementDescription.FromString("A letter of acceptance from a foreign university.");
                var requirementExample = RequirementExample.FromString("acceptance_letter_example.png");

                visa.SetExpectedProcessingTime(VisaExpectedProcessingTime.FromInt(30));

                // Act
                visa.AddRequirement(requirementName, requirementDescription, requirementExample);

                //Assert
                Assert.NotEmpty(visa.Requirements);
            }
Ejemplo n.º 13
0
    public DragonQuest2()
    {
        ID          = "DragonQuest2";
        Name        = "Defeat the Dragon";
        Description = "Defeat the dragon at Northern cave.";
        RequirementDescription.Add("Go to the cave and defeat the dragon.");
        TakeItemRequirements = false;

        // Item Drop from the dragon
        ItemRequirements.Add(new ItemSaveName("Large Dragon Hide", 1));

        // Target minimap points to the bridge
        Targets.Add(new MapTarget(false, "QuestBridgeLoc"));
        // Targets the Cave
        Targets.Add(new MapTarget(false, "QuestCaveLoc"));
        // Targets back to Rose
        Targets.Add(new MapTarget(false, "QuestRoseLoc"));

        InitializeGoals();
    }
Ejemplo n.º 14
0
    public ThorinNecromancyQuest()
    {
        ID          = "ThorinNecromancyQuest";
        Name        = "Help Thorin with his Necromancy Magic";
        Description = "Acquire the dragon's essense and give it to Thorin.";
        RequirementDescription.Add("Go to the cave and defeat the dragon with the Cantis and then give it to Thorin before Rose finds out.");

        // Thorin gives you a Cantis to extract the dragon essense
        // ItemRequirements.Add(new ItemSaveName("Cantis", 1));
        // The cantis charges automatically as the player defeats the dragon
        ItemRequirements.Add(new ItemSaveName("Charged Cantis", 1));

        // Target minimap points to Thorin's house
        Targets.Add(new MapTarget(false, "QuestThorinsHouseLoc"));
        // Targets the Cave
        // Targets.Add(new MapTarget(false, "QuestCaveLoc"));
        // Targets back to Thorin's house

        InitializeGoals();
    }
Ejemplo n.º 15
0
    public RoseQuest1()
    {
        ID          = "RoseQuest1";
        Name        = "New Magic Staff";
        Description = "Rose asked you to perform your new healing spell at the runic circle located in the easter part of the forest before the river.";
        RequirementDescription.Add("Use your healing spell at the center of the runic circle.");
        TakeItemRequirements = false;
        // Check if you have talked to rose
        // DialogueRequirements.Add("RoseRunicCircleQuest", "accepted_incomplete");
        // Checks if you have the staff the runic circle gives the player
        ItemRequirements.Add(new ItemSaveName("Novice Staff", 1));

        // // Points to the exit of the tutorial forest
        // Targets.Add(new MapTarget(false, "QuestForestExitLoc"));
        // Target minimap points to Rose
        Targets.Add(new MapTarget(false, "QuestRoseLoc"));
        // Targets the Runic Circle
        Targets.Add(new MapTarget(false, "QuestRunicCircleLoc"));

        InitializeGoals();
    }
Ejemplo n.º 16
0
    public FindRose()
    {
        ID          = "FindRose";
        Name        = "Talk to Rose";
        Description = "Thorin told you to go East and follow the path South into town and talk to Rose about getting a better staff.";
        RequirementDescription.Add("Talk to Rose.");
        TakeItemRequirements = false;
        ItemRequirements.Add(new ItemSaveName("Uncharged Staff", 1));

        // Check if you have talked to rose
        // DialogueRequirements.Add("RoseRunicCircleQuest", "accepted_incomplete");
        // Checks if you have the staff the runic circle gives the player
        // ItemRequirements.Add(new ItemSaveName("Novice Staff", 1));

        // Points to the exit of the tutorial forest
        Targets.Add(new MapTarget(false, "QuestForestExitLoc"));
        // Target minimap points to Rose
        Targets.Add(new MapTarget(false, "QuestRoseLoc"));
        // // Targets the Runic Circle
        // Targets.Add(new MapTarget(false, "QuestRunicCircleLoc"));

        InitializeGoals();
    }