Skip to content
Snippets Groups Projects
Commit 55ad1977 authored by Nicolai Hollup Brand's avatar Nicolai Hollup Brand :penguin:
Browse files

Merge branch 'test/goals' into 'feat/part-three'

test: goal

See merge request !35
parents 6f676319 bfe5676e
No related branches found
No related tags found
2 merge requests!35test: goal,!7Feat/part three
Pipeline #230964 passed
A story of War an Eilor
::Beginnings
It was a dark and stormy night. You were walking through the woods when you came upon a large, old house.
[Try to open the door](Enter the house)
[Look inside the window](Window peek)
[Look sussy inside the window](Sussy window peek)
::Enter the house
The door is locked. You try to open it, but it won't budge. You pick up an apple.
[Try to force the door open with your strength](Go in)
<ScoreAction>\150/
<HealthAction>\150/
<InventoryAction>\Apple/
::Window peek
You see a mysterious tall blonde and powerful young man in the house. He is wearing a black cloak and holding a wand.
[Try to open the door](Enter the house)
<ScoreAction>\50/
<HealthAction>\150/
::Sussy window peek
You looked sussily trough the window. Eilor saw you, gave a death stare, and you died.
::Go in
You take a deep breath and enter the house through the unlocked window. As you make your way through the dark corridors, you hear the sound of footsteps approaching. Suddenly, the tall blonde man appears before you, wand at the ready. Who are you? he demands. You explain that you were just passing through and sought shelter from the storm. He eyes you suspiciously but eventually nods his head in understanding. I am Eilor, he says, and this is my home. I apologize for my hostility, but I have been on edge lately. You see, our land is on the brink of war. Eilor explains to you that their land has been under siege from an invading army for months, and they have been fighting tirelessly to defend their home. He asks if you would be willing to help them in their struggle.
[Agree to help](Join the fight)
[Decline and leave](Leave the house)
<GoldAction>\5/
<ScoreAction>\75/
<HealthAction>\6/
<InventoryAction>\Sword/
::Join the fight
You agree to help Eilor and his people. Together, you join the fight against the invading army. The battles are long and grueling, but with your help, the people of Eilor are able to hold their ground. As the days turn into weeks, you get to know Eilor better. He tells you stories of his past and the struggles he has faced. You begin to see him not just as a powerful warrior but as a person with hopes and fears just like everyone else. One day, after a particularly difficult battle, Eilor pulls you aside. "I want to thank you," he says. "Without you, I'm not sure we would have made it this far. But more than that, I want you to know that I consider you a friend." With those words, a bond is formed between you and Eilor that will last a lifetime.
::Leave the house
You decline to help Eilor and his people and leave the house. As you continue on your journey, you can't help but wonder what will become of the people of Eilor and their fight against the invading army. Years later, you hear rumors of a great battle that took place in the land of Eilor. Although you were not there, you know that you played a small part in their struggle, and you hope that they were able to emerge victorious. From that day on, you make a vow to always stand up for what is right and to never turn your back on those in need.
A Programmer's Adventure at NTNU
::Morning Routine
As the sun shines through the blinds, the programmer wakes up in his apartment, nestled in the heart of Trondheim. He looks at his NTNU mug, ready to be filled with coffee, the fuel of programmers.
[Continue to Breakfast](Breakfast)
::Breakfast
Breakfast consists of coffee and skolebrød, a traditional Norwegian pastry. He sits at his desk, his workstation waiting for his magic touch. Looking out the window, he enjoys the calmness of Trondheim before his day begins.
[Head to the University](The Journey Begins)
<HealthAction>\-5/
[Suddenly, the power goes out](The Journey Begins)
::The Journey Begins
Leaving his apartment, he heads towards NTNU’s Gløshaugen campus. It’s a brisk and sunny walk, just enough to refresh his mind before the codes begin to fly.
[Arrive at University](First Class of the Day)
<ScoreAction>\12/
[Snow starts falling](First Class of the Day)
::First Class of the Day
His first class of the day is "Advanced Algorithms". The lecture is complex, but he manages to follow along and even answers a couple of questions, impressing his peers and professors.
[Continue to the Library](Library Visit)
::Library Visit
With a few hours until his next class, he heads to the university library. Surrounded by books, his heart is filled with a sense of tranquillity. This is where he prepares for his next project.
[Start Working on Project](Project Time)
<GoldAction>\50/
[Find a book on a new programming concept](Project Time)
<InventoryAction>\Book/
::Project Time
He's working on a project that involves machine learning algorithms. It's challenging but he loves every bit of it. This project is his chance to show his potential.
[Continue Working on the Project](Project Continuation)
::Project Continuation
Hours fly by as he's immersed in his project. He encounters a tricky bug but after some debugging, he squashes it triumphantly.
[End of Day](The Day Ends)
::The Day Ends
The programmer's day at NTNU comes to an end. Filled with adventures, knowledge, and triumphs, it's a day that he will always remember. As he steps out of the university, he looks forward to what the next day will bring.
[Another day](Morning Routine)
\ No newline at end of file
......@@ -49,4 +49,14 @@ class GoalFactoryTest {
Arguments.of(GoalType.SCORE_GOAL, "", ScoreGoal.class)
);
}
@Test
void getGoal_withValidInventoryGoalValue_returnsInventoryGoalObject() {
GoalType goalType = GoalType.INVENTORY_GOAL;
Object goalValue = "item";
Goal<?> goal = GoalFactory.getGoal(goalType, goalValue);
assertEquals(InventoryGoal.class, goal.getClass());
}
}
......@@ -63,5 +63,13 @@ class InventoryGoalTest {
assertThrows(NullPointerException.class, () -> inventoryGoal.isFulfilled(player));
}
@Test
public void can_concatenate_two_InventoryGoals() {
InventoryGoal inventoryGoal1 = new InventoryGoal(getMandatoryInventory());
InventoryGoal inventoryGoal2 = new InventoryGoal(getMandatoryInventory());
inventoryGoal1.concatGoals(inventoryGoal2);
assertEquals(4, inventoryGoal1.getGoalValue().size());
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment