diff --git a/src/main/resources/story-files/Eilor.paths b/src/main/resources/story-files/Eilor.paths deleted file mode 100644 index 19f89fc8d0a70908211e7682527ab5985227168c..0000000000000000000000000000000000000000 --- a/src/main/resources/story-files/Eilor.paths +++ /dev/null @@ -1,38 +0,0 @@ -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. diff --git a/src/main/resources/story-files/Programmer.paths b/src/main/resources/story-files/Programmer.paths new file mode 100644 index 0000000000000000000000000000000000000000..dec5bb342c10d949811b377bd0bc0018d0b5d1e9 --- /dev/null +++ b/src/main/resources/story-files/Programmer.paths @@ -0,0 +1,40 @@ +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 diff --git a/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoalFactoryTest.java b/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoalFactoryTest.java index 04b20f582a43f3bc2bcb498792566a6db1589d5c..b46ce4037943d8fce3dd402673df3c3d02934ab7 100644 --- a/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoalFactoryTest.java +++ b/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoalFactoryTest.java @@ -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()); + } } diff --git a/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/goals/InventoryGoalTest.java b/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/goals/InventoryGoalTest.java index 0fb16f45b04486c4eeeefbc3939ec4c227336eee..a97a096a9d0068297c9dbada004bea3880b0640b 100644 --- a/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/goals/InventoryGoalTest.java +++ b/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/goals/InventoryGoalTest.java @@ -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()); + } } }