From 3e6eead721eb830babe991c03a1872f8f69528f2 Mon Sep 17 00:00:00 2001 From: InKolev Date: Mon, 15 Aug 2016 12:58:20 +0300 Subject: [PATCH] Added exam skeleton and exam author solution --- .../ArmyOfCreatures-All/Solution/.gitignore | 0 .../ArmyOfCreatures.Tests.csproj | 280 +++---- .../BattleManagerAddCreaturesTests.cs | 184 ++--- .../BattleManagerAttackTests.cs | 210 +++--- .../CreatureIdentifierTests.cs | 148 ++-- .../CreaturesFactoryTests.cs | 116 +-- .../MockedClasses/MockedBattleManager.cs | 90 +-- .../Properties/AssemblyInfo.cs | 70 +- .../ArmyOfCreatures.Tests/TestTest.cs | 24 +- .../ArmyOfCreatures.Tests/packages.config | 16 +- .../Solution/ArmyOfCreatures.sln | 56 +- .../Solution}/ArmyOfCreatures/App.config | 0 .../ArmyOfCreatures/ArmyOfCreatures.csproj | 192 ++--- .../Console/Commands/AddCommand.cs | 68 +- .../Console/Commands/AttackCommand.cs | 70 +- .../Console/Commands/CommandManager.cs | 82 +- .../Console/Commands/ExitCommand.cs | 28 +- .../Console/Commands/ICommand.cs | 18 +- .../Console/Commands/ICommandManager.cs | 16 +- .../Console/Commands/SkipCommand.cs | 64 +- .../ArmyOfCreatures/Console/ConsoleWriter.cs | 24 +- .../ArmyOfCreatures/Console/Program.cs | 86 +-- .../Extended/BattleManagerWithThreeArmies.cs | 0 .../Extended/Creatures/AncientBehemoth.cs | 30 +- .../Extended/Creatures/CyclopsKing.cs | 32 +- .../Extended/Creatures/Goblin.cs | 24 +- .../Extended/Creatures/Griffin.cs | 32 +- .../Extended/Creatures/WolfRaider.cs | 28 +- .../Extended/ExtendedCreaturesFactory.cs | 0 .../Extended/Specialties/AddAttackWhenSkip.cs | 0 .../Specialties/DoubleAttackWhenAttacking.cs | 0 .../Extended/Specialties/DoubleDamage.cs | 0 .../Logic/Battles/BattleManager.cs | 342 ++++----- .../Logic/Battles/CreatureIdentifier.cs | 76 +- .../Logic/Battles/CreaturesInBattle.cs | 274 +++---- .../Logic/Battles/IBattleManager.cs | 0 .../Logic/Battles/ICreaturesInBattle.cs | 54 +- .../ArmyOfCreatures/Logic/Creatures/Angel.cs | 26 +- .../Logic/Creatures/ArchDevil.cs | 28 +- .../Logic/Creatures/Archangel.cs | 30 +- .../Logic/Creatures/Behemoth.cs | 26 +- .../Logic/Creatures/Creature.cs | 136 ++-- .../ArmyOfCreatures/Logic/Creatures/Devil.cs | 28 +- .../ArmyOfCreatures/Logic/CreaturesFactory.cs | 60 +- .../Logic/ICreaturesFactory.cs | 18 +- .../ArmyOfCreatures/Logic/ILogger.cs | 0 .../Logic/Specialties/AddDefenseWhenSkip.cs | 74 +- .../Specialties/DoubleDefenseWhenDefending.cs | 98 +-- .../ArmyOfCreatures/Logic/Specialties/Hate.cs | 108 +-- .../ReduceEnemyDefenseByPercentage.cs | 86 +-- .../Logic/Specialties/Resurrection.cs | 46 +- .../Logic/Specialties/Specialty.cs | 66 +- .../Properties/AssemblyInfo.cs | 78 +- .../Solution}/Settings.StyleCop | 0 .../Tests/test.000.001.in.txt | 44 +- .../Tests/test.000.001.out.txt | 128 ++-- .../Tests/test.000.002.in.txt | 36 +- .../Tests/test.000.002.out.txt | 112 +-- .../ArmyOfCreatures-All/Tests/test.001.in.txt | 28 +- .../Tests/test.001.out.txt | 92 +-- .../ArmyOfCreatures-All/Tests/test.002.in.txt | 40 +- .../Tests/test.002.out.txt | 140 ++-- .../ArmyOfCreatures-All/Tests/test.003.in.txt | 22 +- .../Tests/test.003.out.txt | 68 +- .../ArmyOfCreatures-All/Tests/test.004.in.txt | 38 +- .../Tests/test.004.out.txt | 132 ++-- .../ArmyOfCreatures-All/Tests/test.005.in.txt | 44 +- .../Tests/test.005.out.txt | 140 ++-- .../ArmyOfCreatures-All/Tests/test.006.in.txt | 64 +- .../Tests/test.006.out.txt | 188 ++--- .../ArmyOfCreatures-All/Tests/test.007.in.txt | 64 +- .../Tests/test.007.out.txt | 208 +++--- .../ArmyOfCreatures-All/Tests/test.008.in.txt | 36 +- .../Tests/test.008.out.txt | 112 +-- .../ArmyOfCreatures-All/Tests/test.009.in.txt | 44 +- .../Tests/test.009.out.txt | 130 ++-- .../ArmyOfCreatures-All/Tests/test.010.in.txt | 102 +-- .../Tests/test.010.out.txt | 350 ++++----- .../Live-Demo-Morning-Lecture/.gitignore | 0 .../ArmyOfCreatures.Tests.csproj | 0 .../BattleManagerTests.cs | 0 .../ExtendedCreaturesFactoryTests.cs | 0 .../Properties/AssemblyInfo.cs | 0 .../ArmyOfCreatures.Tests/packages.config | 0 .../ArmyOfCreatures.sln | 0 .../ArmyOfCreatures}/App.config | 0 .../ArmyOfCreatures/ArmyOfCreatures.csproj | 0 .../Console/Commands/AddCommand.cs | 0 .../Console/Commands/AttackCommand.cs | 0 .../Console/Commands/CommandManager.cs | 0 .../Console/Commands/ExitCommand.cs | 0 .../Console/Commands/ICommand.cs | 0 .../Console/Commands/ICommandManager.cs | 0 .../Console/Commands/SkipCommand.cs | 0 .../ArmyOfCreatures/Console/ConsoleWriter.cs | 0 .../ArmyOfCreatures/Console/Program.cs | 0 .../Extended/BattleManagerWithThreeArmies.cs | 114 +-- .../Extended/Creatures/AncientBehemoth.cs | 0 .../Extended/Creatures/CyclopsKing.cs | 0 .../Extended/Creatures/Goblin.cs | 0 .../Extended/Creatures/Griffin.cs | 0 .../Extended/Creatures/WolfRaider.cs | 0 .../Extended/ExtendedCreaturesFactory.cs | 56 +- .../Extended/Specialties/AddAttackWhenSkip.cs | 76 +- .../Specialties/DoubleAttackWhenAttacking.cs | 100 +-- .../Extended/Specialties/DoubleDamage.cs | 116 +-- .../Logic/Battles/BattleManager.cs | 0 .../Logic/Battles/CreatureIdentifier.cs | 0 .../Logic/Battles/CreaturesInBattle.cs | 0 .../Logic/Battles/IBattleManager.cs | 22 +- .../Logic/Battles/ICreaturesInBattle.cs | 0 .../ArmyOfCreatures/Logic/Creatures/Angel.cs | 0 .../Logic/Creatures/ArchDevil.cs | 0 .../Logic/Creatures/Archangel.cs | 0 .../Logic/Creatures/Behemoth.cs | 0 .../Logic/Creatures/Creature.cs | 0 .../ArmyOfCreatures/Logic/Creatures/Devil.cs | 0 .../ArmyOfCreatures/Logic/CreaturesFactory.cs | 0 .../Logic/ICreaturesFactory.cs | 0 .../ArmyOfCreatures/Logic/ILogger.cs | 14 +- .../Logic/Specialties/AddDefenseWhenSkip.cs | 0 .../Specialties/DoubleDefenseWhenDefending.cs | 0 .../ArmyOfCreatures/Logic/Specialties/Hate.cs | 0 .../ReduceEnemyDefenseByPercentage.cs | 0 .../Logic/Specialties/Resurrection.cs | 0 .../Logic/Specialties/Specialty.cs | 0 .../Properties/AssemblyInfo.cs | 0 .../Settings.StyleCop | 436 +++++------ .../\320\242estsRequirements.md" | 0 .../README.md | 0 .../Cosmetics.Tests/Common/ValidatorTests.cs | 0 .../Cosmetics.Tests/Cosmetics.Tests.csproj | 0 .../Cosmetics.Tests/Engine/CommandTests.cs | 0 .../Engine/CosmeticsEngineTests.cs | 0 .../Engine/CosmeticsFactoryTests.cs | 0 .../Engine/Mocks/MockedCosmeticsEngine.cs | 0 .../Cosmetics.Tests/Products/CategoryTests.cs | 0 .../Products/Mocks/MockedCategory.cs | 0 .../Products/Mocks/MockedShoppingCart.cs | 0 .../Cosmetics.Tests/Products/ShampooTests.cs | 0 .../Products/ShoppingCartTests.cs | 0 .../Products/ToothpasteTests.cs | 0 .../Properties/AssemblyInfo.cs | 0 .../Solution/Cosmetics.Tests/packages.config | 0 .../Solution/Cosmetics.sln | 0 .../Solution/Cosmetics}/App.config | 10 +- .../Solution/Cosmetics/Common/GenderType.cs | 0 .../Cosmetics/Common/GlobalErrorMessages.cs | 0 .../Solution/Cosmetics/Common/UsageType.cs | 0 .../Solution/Cosmetics/Common/Validator.cs | 0 .../Solution/Cosmetics/Contracts/ICategory.cs | 0 .../Solution/Cosmetics/Contracts/ICommand.cs | 0 .../Cosmetics/Contracts/ICommandParser.cs | 0 .../Cosmetics/Contracts/ICosmeticsFactory.cs | 0 .../Solution/Cosmetics/Contracts/IEngine.cs | 0 .../Solution/Cosmetics/Contracts/IProduct.cs | 0 .../Solution/Cosmetics/Contracts/IShampoo.cs | 0 .../Cosmetics/Contracts/IShoppingCart.cs | 0 .../Cosmetics/Contracts/IToothpaste.cs | 0 .../Solution/Cosmetics/Cosmetics.csproj | 0 .../Solution/Cosmetics/CosmeticsProgram.cs | 0 .../Solution/Cosmetics/Engine/Command.cs | 0 .../Cosmetics/Engine/ConsoleCommandParser.cs | 0 .../Cosmetics/Engine/CosmeticsEngine.cs | 0 .../Cosmetics/Engine/CosmeticsFactory.cs | 0 .../Solution/Cosmetics/Products/Category.cs | 0 .../Solution/Cosmetics/Products/Product.cs | 0 .../Solution/Cosmetics/Products/Shampoo.cs | 0 .../Cosmetics/Products/ShoppingCart.cs | 0 .../Solution/Cosmetics/Products/Toothpaste.cs | 0 .../Cosmetics/Properties/AssemblyInfo.cs | 0 .../Tests/test.000.001.in.txt | 0 .../Tests/test.000.001.out.txt | 0 .../Tests/test.001.in.txt | 0 .../Tests/test.001.out.txt | 0 .../Tests/test.002.in.txt | 0 .../Tests/test.002.out.txt | 0 .../Tests/test.003.in.txt | 0 .../Tests/test.003.out.txt | 0 .../Tests/test.004.in.txt | 0 .../Tests/test.004.out.txt | 0 .../Tests/test.005.in.txt | 0 .../Tests/test.005.out.txt | 0 .../Tests/test.006.in.txt | 0 .../Tests/test.006.out.txt | 0 .../Tests/test.007.in.txt | 0 .../Tests/test.007.out.txt | 0 .../Tests/test.008.in.txt | 0 .../Tests/test.008.out.txt | 0 .../Tests/test.009.in.txt | 0 .../Tests/test.009.out.txt | 0 .../Tests/test.010.in.txt | 0 .../Tests/test.010.out.txt | 0 .../IntergalacticTravel.Tests.csproj | 148 ++++ .../Properties/AssemblyInfo.cs | 36 + .../IntergalacticTravel.Tests/packages.config | 10 + .../IntergalacticTravel.sln | 28 + .../IntergalacticTravel/BusinessOwner.cs | 32 + .../Constants/GlobalConstants.cs | 9 + .../Contracts/IBusinessOwner.cs | 9 + .../Contracts/IGPSCoordinates.cs | 12 + .../IntergalacticTravel/Contracts/IGalaxy.cs | 9 + .../Contracts/ILocation.cs | 9 + .../Contracts/INameable.cs | 7 + .../IntergalacticTravel/Contracts/IPath.cs | 9 + .../IntergalacticTravel/Contracts/IPlanet.cs | 11 + .../Contracts/IResources.cs | 19 + .../Contracts/IResourcesFactory.cs | 13 + .../Contracts/ITeleportStation.cs | 9 + .../IntergalacticTravel/Contracts/IUnit.cs | 19 + .../InsufficientResourcesException.cs | 24 + .../InvalidTeleportationLocationException.cs | 24 + .../InvalidUnitCreationCommandException.cs | 24 + .../Exceptions/LocationNotFoundException.cs | 24 + .../Exceptions/TeleportOutOfRangeException.cs | 32 + .../Extensions/IEnumerableExtensions.cs | 14 + .../Extensions/ObjectExtensions.cs | 15 + .../IntergalacticTravel.csproj | 82 ++ .../IntergalacticTravel/Lacaille.cs | 12 + .../IntergalacticTravel/Luyten.cs | 12 + .../IntergalacticTravel/Procyon.cs | 12 + .../Properties/AssemblyInfo.cs | 40 + .../IntergalacticTravel/Resources.cs | 99 +++ .../IntergalacticTravel/ResourcesFactory.cs | 65 ++ .../IntergalacticTravel/TeleportStation.cs | 122 +++ .../IntergalacticTravel/Unit.cs | 86 +++ .../IntergalacticTravel/UnitsFactory.cs | 34 + Topics/06. Exam (Skeleton)/README.html | 591 +++++++++++++++ Topics/06. Exam (Skeleton)/README.md | 93 +++ .../BusinessOwner/CollectProfits_Should.cs | 53 ++ .../IntergalacticTravel.Tests.csproj | 152 ++++ .../Properties/AssemblyInfo.cs | 36 + .../ResourcesFactory/GetResources_Should.cs | 64 ++ .../TeleportStation/Constructor_Should.cs | 38 + .../TeleportStation/PayProfits_Should.cs | 104 +++ .../TeleportStation/TeleportUnit_Should.cs | 698 ++++++++++++++++++ .../Unit/Pay_Should.cs | 81 ++ .../UnitsFactory/GetUnit_Should.cs | 62 ++ .../IntergalacticTravel.Tests/packages.config | 8 + .../IntergalacticTravel.sln | 28 + .../IntergalacticTravel/BusinessOwner.cs | 32 + .../Constants/GlobalConstants.cs | 9 + .../Contracts/IBusinessOwner.cs | 9 + .../Contracts/IGPSCoordinates.cs | 12 + .../IntergalacticTravel/Contracts/IGalaxy.cs | 9 + .../Contracts/ILocation.cs | 9 + .../Contracts/INameable.cs | 7 + .../IntergalacticTravel/Contracts/IPath.cs | 9 + .../IntergalacticTravel/Contracts/IPlanet.cs | 11 + .../Contracts/IResources.cs | 19 + .../Contracts/IResourcesFactory.cs | 13 + .../Contracts/ITeleportStation.cs | 9 + .../IntergalacticTravel/Contracts/IUnit.cs | 19 + .../InsufficientResourcesException.cs | 24 + .../InvalidTeleportationLocationException.cs | 24 + .../InvalidUnitCreationCommandException.cs | 24 + .../Exceptions/LocationNotFoundException.cs | 24 + .../Exceptions/TeleportOutOfRangeException.cs | 32 + .../ExtendedTeleportStation.cs | 45 ++ .../Extensions/IEnumerableExtensions.cs | 14 + .../Extensions/ObjectExtensions.cs | 15 + .../IntergalacticTravel.csproj | 84 +++ .../IntergalacticTravel/Lacaille.cs | 12 + .../IntergalacticTravel/Luyten.cs | 12 + .../IntergalacticTravel/Procyon.cs | 12 + .../Properties/AssemblyInfo.cs | 39 + .../IntergalacticTravel/Resources.cs | 99 +++ .../IntergalacticTravel/ResourcesFactory.cs | 65 ++ .../IntergalacticTravel/TeleportStation.cs | 122 +++ .../TheOneThatRulesThemAll.cs | 25 + .../IntergalacticTravel/Unit.cs | 86 +++ .../IntergalacticTravel/UnitsFactory.cs | 34 + 272 files changed, 7551 insertions(+), 3474 deletions(-) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/.gitignore (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/ArmyOfCreatures.Tests.csproj (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAddCreaturesTests.cs (97%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAttackTests.cs (97%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreatureIdentifierTests.cs (97%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreaturesFactoryTests.cs (97%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/MockedClasses/MockedBattleManager.cs (97%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/Properties/AssemblyInfo.cs (97%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/TestTest.cs (93%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/packages.config (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.sln (98%) rename Topics/{04. Workshop(Trainers)/Live-Demo-Morning-Lecture => 04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution}/ArmyOfCreatures/App.config (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/ArmyOfCreatures.csproj (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AddCommand.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AttackCommand.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/CommandManager.cs (97%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ExitCommand.cs (95%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommand.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommandManager.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/SkipCommand.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/ConsoleWriter.cs (95%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Program.cs (97%) rename Topics/{04. Workshop(Trainers)/Live-Demo-Morning-Lecture => 04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution}/ArmyOfCreatures/Extended/BattleManagerWithThreeArmies.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Goblin.cs (94%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Griffin.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs (95%) rename Topics/{04. Workshop(Trainers)/Live-Demo-Morning-Lecture => 04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution}/ArmyOfCreatures/Extended/ExtendedCreaturesFactory.cs (100%) rename Topics/{04. Workshop(Trainers)/Live-Demo-Morning-Lecture => 04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution}/ArmyOfCreatures/Extended/Specialties/AddAttackWhenSkip.cs (100%) rename Topics/{04. Workshop(Trainers)/Live-Demo-Morning-Lecture => 04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution}/ArmyOfCreatures/Extended/Specialties/DoubleAttackWhenAttacking.cs (100%) rename Topics/{04. Workshop(Trainers)/Live-Demo-Morning-Lecture => 04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution}/ArmyOfCreatures/Extended/Specialties/DoubleDamage.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/BattleManager.cs (97%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreatureIdentifier.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreaturesInBattle.cs (96%) rename Topics/{04. Workshop(Trainers)/Live-Demo-Morning-Lecture => 04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution}/ArmyOfCreatures/Logic/Battles/IBattleManager.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs (95%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Angel.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Archangel.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Behemoth.cs (95%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Creature.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Devil.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/CreaturesFactory.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ICreaturesFactory.cs (95%) rename Topics/{04. Workshop(Trainers)/Live-Demo-Morning-Lecture => 04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution}/ArmyOfCreatures/Logic/ILogger.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/AddDefenseWhenSkip.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/DoubleDefenseWhenDefending.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Hate.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/ReduceEnemyDefenseByPercentage.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Resurrection.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Specialty.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Properties/AssemblyInfo.cs (97%) rename Topics/{04. Workshop(Trainers)/Live-Demo-Morning-Lecture => 04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution}/Settings.StyleCop (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.in.txt (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.out.txt (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.in.txt (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.out.txt (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.in.txt (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.out.txt (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.in.txt (97%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.out.txt (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.in.txt (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.out.txt (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.in.txt (97%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.out.txt (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.in.txt (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.out.txt (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.in.txt (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.out.txt (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.in.txt (97%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.out.txt (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.in.txt (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.out.txt (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.in.txt (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.out.txt (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.in.txt (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.out.txt (98%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/.gitignore (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/ArmyOfCreatures.Tests.csproj (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/BattleManagerTests.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/ExtendedCreaturesFactoryTests.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/Properties/AssemblyInfo.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/packages.config (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures.sln (100%) rename Topics/{05. Workshop(Students)/Solution/Cosmetics => 04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures}/App.config (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/ArmyOfCreatures.csproj (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/AddCommand.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/AttackCommand.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/CommandManager.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ExitCommand.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ICommand.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ICommandManager.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/SkipCommand.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/ConsoleWriter.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Program.cs (100%) rename Topics/{04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution => 04. Workshop (Trainers)/Live-Demo-Morning-Lecture}/ArmyOfCreatures/Extended/BattleManagerWithThreeArmies.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/Goblin.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/Griffin.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs (100%) rename Topics/{04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution => 04. Workshop (Trainers)/Live-Demo-Morning-Lecture}/ArmyOfCreatures/Extended/ExtendedCreaturesFactory.cs (96%) rename Topics/{04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution => 04. Workshop (Trainers)/Live-Demo-Morning-Lecture}/ArmyOfCreatures/Extended/Specialties/AddAttackWhenSkip.cs (96%) rename Topics/{04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution => 04. Workshop (Trainers)/Live-Demo-Morning-Lecture}/ArmyOfCreatures/Extended/Specialties/DoubleAttackWhenAttacking.cs (96%) rename Topics/{04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution => 04. Workshop (Trainers)/Live-Demo-Morning-Lecture}/ArmyOfCreatures/Extended/Specialties/DoubleDamage.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/BattleManager.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/CreatureIdentifier.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/CreaturesInBattle.cs (100%) rename Topics/{04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution => 04. Workshop (Trainers)/Live-Demo-Morning-Lecture}/ArmyOfCreatures/Logic/Battles/IBattleManager.cs (96%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Angel.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Archangel.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Behemoth.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Creature.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Devil.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/CreaturesFactory.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/ICreaturesFactory.cs (100%) rename Topics/{04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution => 04. Workshop (Trainers)/Live-Demo-Morning-Lecture}/ArmyOfCreatures/Logic/ILogger.cs (94%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/AddDefenseWhenSkip.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/DoubleDefenseWhenDefending.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Hate.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/ReduceEnemyDefenseByPercentage.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Resurrection.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Specialty.cs (100%) rename Topics/{04. Workshop(Trainers) => 04. Workshop (Trainers)}/Live-Demo-Morning-Lecture/ArmyOfCreatures/Properties/AssemblyInfo.cs (100%) rename Topics/{04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution => 04. Workshop (Trainers)/Live-Demo-Morning-Lecture}/Settings.StyleCop (97%) rename "Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/\320\242estsRequirements.md" => "Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/\320\242estsRequirements.md" (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/README.md (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Common/ValidatorTests.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Cosmetics.Tests.csproj (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Engine/CommandTests.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Engine/CosmeticsEngineTests.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Engine/CosmeticsFactoryTests.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Engine/Mocks/MockedCosmeticsEngine.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Products/CategoryTests.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Products/Mocks/MockedCategory.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Products/Mocks/MockedShoppingCart.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Products/ShampooTests.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Products/ShoppingCartTests.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Products/ToothpasteTests.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/Properties/AssemblyInfo.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.Tests/packages.config (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics.sln (100%) rename Topics/{04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures => 05. Workshop (Students)/Solution/Cosmetics}/App.config (97%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Common/GenderType.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Common/GlobalErrorMessages.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Common/UsageType.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Common/Validator.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Contracts/ICategory.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Contracts/ICommand.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Contracts/ICommandParser.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Contracts/ICosmeticsFactory.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Contracts/IEngine.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Contracts/IProduct.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Contracts/IShampoo.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Contracts/IShoppingCart.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Contracts/IToothpaste.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Cosmetics.csproj (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/CosmeticsProgram.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Engine/Command.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Engine/ConsoleCommandParser.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Engine/CosmeticsEngine.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Engine/CosmeticsFactory.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Products/Category.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Products/Product.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Products/Shampoo.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Products/ShoppingCart.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Products/Toothpaste.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Solution/Cosmetics/Properties/AssemblyInfo.cs (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.000.001.in.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.000.001.out.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.001.in.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.001.out.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.002.in.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.002.out.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.003.in.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.003.out.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.004.in.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.004.out.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.005.in.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.005.out.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.006.in.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.006.out.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.007.in.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.007.out.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.008.in.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.008.out.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.009.in.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.009.out.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.010.in.txt (100%) rename Topics/{05. Workshop(Students) => 05. Workshop (Students)}/Tests/test.010.out.txt (100%) create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel.Tests/IntergalacticTravel.Tests.csproj create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel.Tests/Properties/AssemblyInfo.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel.Tests/packages.config create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel.sln create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/BusinessOwner.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Constants/GlobalConstants.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IBusinessOwner.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IGPSCoordinates.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IGalaxy.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/ILocation.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/INameable.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IPath.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IPlanet.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IResources.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IResourcesFactory.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/ITeleportStation.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IUnit.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/InsufficientResourcesException.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/InvalidTeleportationLocationException.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/InvalidUnitCreationCommandException.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/LocationNotFoundException.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/TeleportOutOfRangeException.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Extensions/IEnumerableExtensions.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Extensions/ObjectExtensions.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/IntergalacticTravel.csproj create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Lacaille.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Luyten.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Procyon.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Properties/AssemblyInfo.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Resources.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/ResourcesFactory.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/TeleportStation.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/Unit.cs create mode 100644 Topics/06. Exam (Skeleton)/IntergalacticTravel/UnitsFactory.cs create mode 100644 Topics/06. Exam (Skeleton)/README.html create mode 100644 Topics/06. Exam (Skeleton)/README.md create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/BusinessOwner/CollectProfits_Should.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/IntergalacticTravel.Tests.csproj create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/Properties/AssemblyInfo.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/ResourcesFactory/GetResources_Should.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/TeleportStation/Constructor_Should.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/TeleportStation/PayProfits_Should.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/TeleportStation/TeleportUnit_Should.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/Unit/Pay_Should.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/UnitsFactory/GetUnit_Should.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/packages.config create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel.sln create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/BusinessOwner.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Constants/GlobalConstants.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IBusinessOwner.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IGPSCoordinates.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IGalaxy.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/ILocation.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/INameable.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IPath.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IPlanet.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IResources.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IResourcesFactory.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/ITeleportStation.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IUnit.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/InsufficientResourcesException.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/InvalidTeleportationLocationException.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/InvalidUnitCreationCommandException.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/LocationNotFoundException.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/TeleportOutOfRangeException.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/ExtendedTeleportStation.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Extensions/IEnumerableExtensions.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Extensions/ObjectExtensions.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/IntergalacticTravel.csproj create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Lacaille.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Luyten.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Procyon.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Properties/AssemblyInfo.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Resources.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/ResourcesFactory.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/TeleportStation.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/TheOneThatRulesThemAll.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/Unit.cs create mode 100644 Topics/07. Exam (Author solution)/IntergalacticTravel/UnitsFactory.cs diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/.gitignore b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/.gitignore similarity index 100% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/.gitignore rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/.gitignore diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/ArmyOfCreatures.Tests.csproj b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/ArmyOfCreatures.Tests.csproj similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/ArmyOfCreatures.Tests.csproj rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/ArmyOfCreatures.Tests.csproj index af1628b..482d626 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/ArmyOfCreatures.Tests.csproj +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/ArmyOfCreatures.Tests.csproj @@ -1,141 +1,141 @@ - - - - Debug - AnyCPU - {2E8E9435-F4D8-413F-BA30-2DCD396063DF} - Library - Properties - ArmyOfCreatures.Tests - ArmyOfCreatures.Tests - v4.5.2 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll - True - - - ..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.dll - False - - - ..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.Mdb.dll - False - - - ..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.Pdb.dll - False - - - ..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.Rocks.dll - False - - - ..\packages\Moq.4.5.16\lib\net45\Moq.dll - True - - - ..\packages\NUnit3TestAdapter.3.4.0\lib\nunit.engine.dll - False - - - ..\packages\NUnit3TestAdapter.3.4.0\lib\nunit.engine.api.dll - False - - - ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll - True - - - ..\packages\NUnit3TestAdapter.3.4.0\lib\NUnit3.TestAdapter.dll - False - - - ..\packages\AutoFixture.3.49.0\lib\net40\Ploeh.AutoFixture.dll - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {bb52e531-9691-46af-9ed3-0ec7b011fbec} - ArmyOfCreatures - - - - - - - - False - - - False - - - False - - - False - - - - - - - + + + + Debug + AnyCPU + {2E8E9435-F4D8-413F-BA30-2DCD396063DF} + Library + Properties + ArmyOfCreatures.Tests + ArmyOfCreatures.Tests + v4.5.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll + True + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.dll + False + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.Mdb.dll + False + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.Pdb.dll + False + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.Rocks.dll + False + + + ..\packages\Moq.4.5.16\lib\net45\Moq.dll + True + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\nunit.engine.dll + False + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\nunit.engine.api.dll + False + + + ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll + True + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\NUnit3.TestAdapter.dll + False + + + ..\packages\AutoFixture.3.49.0\lib\net40\Ploeh.AutoFixture.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {bb52e531-9691-46af-9ed3-0ec7b011fbec} + ArmyOfCreatures + + + + + + + + False + + + False + + + False + + + False + + + + + + + \ No newline at end of file diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAddCreaturesTests.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAddCreaturesTests.cs similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAddCreaturesTests.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAddCreaturesTests.cs index 56fdb38..b39112a 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAddCreaturesTests.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAddCreaturesTests.cs @@ -1,92 +1,92 @@ -using System; -using ArmyOfCreatures.Logic; -using ArmyOfCreatures.Logic.Battles; -using ArmyOfCreatures.Logic.Creatures; -using Moq; -using NUnit.Framework; -using Ploeh.AutoFixture; -using Ploeh.AutoFixture.Kernel; - -namespace ArmyOfCreatures.Tests -{ - [TestFixture] - public class BattleManagerAddCreaturesTests - { - [Test] - public void AddCreatures_WhenCreatureIdentifierIsNull_ShouldThrowArgumentNullException() - { - // Arrange - var mockedFactory = new Mock(); - var mockedLogger = new Mock(); - - var battleManager = new BattleManager(null, mockedLogger.Object); - - // Act & Assert - Assert.Throws(() => battleManager.AddCreatures(null, 1)); - } - - [Test] - public void AddCreatures_WhenValidIdentifierIsPassed_FactoryShouldCallCreateCreature() - { - // Arrange - var mockedFactory = new Mock(); - var mockedLogger = new Mock(); - - var battleManager = new BattleManager(mockedFactory.Object, mockedLogger.Object); - - var fixture = new Fixture(); - - fixture.Customizations.Add( - new TypeRelay( - typeof(Creature), - typeof(Angel))); - - var creature = fixture.Create(); - - mockedFactory.Setup(x => x.CreateCreature(It.IsAny())).Returns(creature); - - // The code itself should be refactored. Think about sealed class to be changed or the static method itself - // You could use an unconstrained Mocking framework - var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); - - // Act - battleManager.AddCreatures(identifier, 1); - - // Assert - mockedFactory.Verify(x => x.CreateCreature(It.IsAny()), Times.Exactly(1)); - } - - [Test] - public void AddCreatures_WhenValidIdentifierIsPassed_WritelineShoulbeCalled() - { - var mockedFactory = new Mock(); - var mockedLogger = new Mock(); - - var battleManager = new BattleManager(mockedFactory.Object, mockedLogger.Object); - - var fixture = new Fixture(); - - fixture.Customizations.Add( - new TypeRelay( - typeof(Creature), - typeof(Angel))); - - var creature = fixture.Create(); - - // var creature = new Angel(); - mockedFactory.Setup(x => x.CreateCreature(It.IsAny())).Returns(creature); - - mockedLogger.Setup(x => x.WriteLine(It.IsAny())); - - // The code itself should be refactored. Think about sealed class to be changed or the static method itself - // You could use an unconstrained Mocking framework - var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); - - // Act - battleManager.AddCreatures(identifier, 1); - - // Assert - mockedLogger.Verify(x => x.WriteLine(It.IsAny()), Times.Exactly(1)); - } - } -} +using System; +using ArmyOfCreatures.Logic; +using ArmyOfCreatures.Logic.Battles; +using ArmyOfCreatures.Logic.Creatures; +using Moq; +using NUnit.Framework; +using Ploeh.AutoFixture; +using Ploeh.AutoFixture.Kernel; + +namespace ArmyOfCreatures.Tests +{ + [TestFixture] + public class BattleManagerAddCreaturesTests + { + [Test] + public void AddCreatures_WhenCreatureIdentifierIsNull_ShouldThrowArgumentNullException() + { + // Arrange + var mockedFactory = new Mock(); + var mockedLogger = new Mock(); + + var battleManager = new BattleManager(null, mockedLogger.Object); + + // Act & Assert + Assert.Throws(() => battleManager.AddCreatures(null, 1)); + } + + [Test] + public void AddCreatures_WhenValidIdentifierIsPassed_FactoryShouldCallCreateCreature() + { + // Arrange + var mockedFactory = new Mock(); + var mockedLogger = new Mock(); + + var battleManager = new BattleManager(mockedFactory.Object, mockedLogger.Object); + + var fixture = new Fixture(); + + fixture.Customizations.Add( + new TypeRelay( + typeof(Creature), + typeof(Angel))); + + var creature = fixture.Create(); + + mockedFactory.Setup(x => x.CreateCreature(It.IsAny())).Returns(creature); + + // The code itself should be refactored. Think about sealed class to be changed or the static method itself + // You could use an unconstrained Mocking framework + var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); + + // Act + battleManager.AddCreatures(identifier, 1); + + // Assert + mockedFactory.Verify(x => x.CreateCreature(It.IsAny()), Times.Exactly(1)); + } + + [Test] + public void AddCreatures_WhenValidIdentifierIsPassed_WritelineShoulbeCalled() + { + var mockedFactory = new Mock(); + var mockedLogger = new Mock(); + + var battleManager = new BattleManager(mockedFactory.Object, mockedLogger.Object); + + var fixture = new Fixture(); + + fixture.Customizations.Add( + new TypeRelay( + typeof(Creature), + typeof(Angel))); + + var creature = fixture.Create(); + + // var creature = new Angel(); + mockedFactory.Setup(x => x.CreateCreature(It.IsAny())).Returns(creature); + + mockedLogger.Setup(x => x.WriteLine(It.IsAny())); + + // The code itself should be refactored. Think about sealed class to be changed or the static method itself + // You could use an unconstrained Mocking framework + var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); + + // Act + battleManager.AddCreatures(identifier, 1); + + // Assert + mockedLogger.Verify(x => x.WriteLine(It.IsAny()), Times.Exactly(1)); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAttackTests.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAttackTests.cs similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAttackTests.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAttackTests.cs index 12a74da..bcfc14c 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAttackTests.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/BattleManagerAttackTests.cs @@ -1,105 +1,105 @@ -using System; -using ArmyOfCreatures.Logic; -using ArmyOfCreatures.Logic.Battles; -using ArmyOfCreatures.Logic.Creatures; -using ArmyOfCreatures.Tests.MockedClasses; -using Moq; -using NUnit.Framework; - -namespace ArmyOfCreatures.Tests -{ - [TestFixture] - public class BattleManagerAttackTests - { - [Test] - public void Attack_WhenAttackingCreatureIdentifierIsNull_ShouldThrowArgumentException() - { - // Arrange - var mockedFactory = new Mock(); - var mockedLogger = new Mock(); - - var battleManager = new MockedBattleManager(mockedFactory.Object, mockedLogger.Object); - - // The code itself should be refactored. Think about sealed class to be changed or the static method itself - // You could use an unconstrained Mocking framework - var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); - - // Act & Assert - Assert.Throws(() => battleManager.Attack(identifier, identifier)); - } - - [Test] - public void Attack_WhenDefenderCreatureIdentifierIsNull_ShouldThrowArgumentException() - { - // Arrange - var mockedFactory = new Mock(); - var mockedLogger = new Mock(); - - var battleManager = new BattleManager(mockedFactory.Object, mockedLogger.Object); - - // The code itself should be refactored. Think about sealed class to be changed or the static method itself - // You could use an unconstrained Mocking framework - var identifier = CreatureIdentifier.CreatureIdentifierFromString("Pesho(1)"); - - // Act & Assert - Assert.Throws(() => battleManager.Attack(identifier, identifier)); - } - - [Test] - public void Attack_WhenAttackIsSucessful_ShouldCallWriteline6Times() - { - // Arrange - var mockedFactory = new Mock(); - var mockedLogger = new Mock(); - - var battleManager = new MockedBattleManager(mockedFactory.Object, mockedLogger.Object); - - // The code itself should be refactored. Think about sealed class to be changed or the static method itself - // You could use an unconstrained Mocking framework - var identifierAttacker = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); - var identifierDefender = CreatureIdentifier.CreatureIdentifierFromString("Angel(2)"); - - var creature = new Angel(); - - mockedFactory.Setup(x => x.CreateCreature(It.IsAny())).Returns(creature); - - mockedLogger.Setup(x => x.WriteLine(It.IsAny())); - - battleManager.AddCreatures(identifierAttacker, 1); - battleManager.AddCreatures(identifierDefender, 1); - - // Act - battleManager.Attack(identifierAttacker, identifierDefender); - - // Assert - mockedLogger.Verify(x => x.WriteLine(It.IsAny()), Times.Exactly(6)); - } - - [Test] - public void Attack_WhenAttackingOwnArmy_ShouldThrow() - { - // Arrange - var mockedFactory = new Mock(); - var mockedLogger = new Mock(); - var mockedCreaturesInBattle = new Mock(); - - var battleManager = new MockedBattleManager(mockedFactory.Object, mockedLogger.Object); - - // The code itself should be refactored. Think about sealed class to be changed or the static method itself - // You could use an unconstrained Mocking framework - var identifierAttacker = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); - var identifierDefender = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); - - var creature = new Angel(); - - mockedFactory.Setup(x => x.CreateCreature(It.IsAny())).Returns(creature); - mockedLogger.Setup(x => x.WriteLine(It.IsAny())); - - battleManager.AddCreatures(identifierAttacker, 1); - battleManager.AddCreatures(identifierDefender, 1); - - // Act and Assert - Assert.Throws(() => battleManager.Attack(identifierAttacker, identifierDefender)); - } - } -} +using System; +using ArmyOfCreatures.Logic; +using ArmyOfCreatures.Logic.Battles; +using ArmyOfCreatures.Logic.Creatures; +using ArmyOfCreatures.Tests.MockedClasses; +using Moq; +using NUnit.Framework; + +namespace ArmyOfCreatures.Tests +{ + [TestFixture] + public class BattleManagerAttackTests + { + [Test] + public void Attack_WhenAttackingCreatureIdentifierIsNull_ShouldThrowArgumentException() + { + // Arrange + var mockedFactory = new Mock(); + var mockedLogger = new Mock(); + + var battleManager = new MockedBattleManager(mockedFactory.Object, mockedLogger.Object); + + // The code itself should be refactored. Think about sealed class to be changed or the static method itself + // You could use an unconstrained Mocking framework + var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); + + // Act & Assert + Assert.Throws(() => battleManager.Attack(identifier, identifier)); + } + + [Test] + public void Attack_WhenDefenderCreatureIdentifierIsNull_ShouldThrowArgumentException() + { + // Arrange + var mockedFactory = new Mock(); + var mockedLogger = new Mock(); + + var battleManager = new BattleManager(mockedFactory.Object, mockedLogger.Object); + + // The code itself should be refactored. Think about sealed class to be changed or the static method itself + // You could use an unconstrained Mocking framework + var identifier = CreatureIdentifier.CreatureIdentifierFromString("Pesho(1)"); + + // Act & Assert + Assert.Throws(() => battleManager.Attack(identifier, identifier)); + } + + [Test] + public void Attack_WhenAttackIsSucessful_ShouldCallWriteline6Times() + { + // Arrange + var mockedFactory = new Mock(); + var mockedLogger = new Mock(); + + var battleManager = new MockedBattleManager(mockedFactory.Object, mockedLogger.Object); + + // The code itself should be refactored. Think about sealed class to be changed or the static method itself + // You could use an unconstrained Mocking framework + var identifierAttacker = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); + var identifierDefender = CreatureIdentifier.CreatureIdentifierFromString("Angel(2)"); + + var creature = new Angel(); + + mockedFactory.Setup(x => x.CreateCreature(It.IsAny())).Returns(creature); + + mockedLogger.Setup(x => x.WriteLine(It.IsAny())); + + battleManager.AddCreatures(identifierAttacker, 1); + battleManager.AddCreatures(identifierDefender, 1); + + // Act + battleManager.Attack(identifierAttacker, identifierDefender); + + // Assert + mockedLogger.Verify(x => x.WriteLine(It.IsAny()), Times.Exactly(6)); + } + + [Test] + public void Attack_WhenAttackingOwnArmy_ShouldThrow() + { + // Arrange + var mockedFactory = new Mock(); + var mockedLogger = new Mock(); + var mockedCreaturesInBattle = new Mock(); + + var battleManager = new MockedBattleManager(mockedFactory.Object, mockedLogger.Object); + + // The code itself should be refactored. Think about sealed class to be changed or the static method itself + // You could use an unconstrained Mocking framework + var identifierAttacker = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); + var identifierDefender = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); + + var creature = new Angel(); + + mockedFactory.Setup(x => x.CreateCreature(It.IsAny())).Returns(creature); + mockedLogger.Setup(x => x.WriteLine(It.IsAny())); + + battleManager.AddCreatures(identifierAttacker, 1); + battleManager.AddCreatures(identifierDefender, 1); + + // Act and Assert + Assert.Throws(() => battleManager.Attack(identifierAttacker, identifierDefender)); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreatureIdentifierTests.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreatureIdentifierTests.cs similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreatureIdentifierTests.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreatureIdentifierTests.cs index 5a8f85f..8576a7a 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreatureIdentifierTests.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreatureIdentifierTests.cs @@ -1,74 +1,74 @@ -using System; -using ArmyOfCreatures.Logic.Battles; -using NUnit.Framework; - -namespace ArmyOfCreatures.Tests -{ - [TestFixture] - public class CreatureIdentifierTests - { - [Test] - public void CreatureIdentifier_WhenNullValueIsPassed_ShouldThrowArgumentNullException() - { - // Arrange, Act & Assert - Assert.Throws(() => CreatureIdentifier.CreatureIdentifierFromString(null)); - } - - [Test] - public void CreatureIdentifier_WhenInvalidValueToParseIntIsPassed_ShouldThrowArgumentNullException() - { - // Arrange, Act & Assert - Assert.Throws(() => CreatureIdentifier.CreatureIdentifierFromString("Angel(test)")); - } - - [Test] - public void CreatureIdentifier_WhenInvalidValueIsPassed_ShouldThrowIndexOutOfRangeException() - { - // Arrange, Act & Assert - Assert.Throws(() => CreatureIdentifier.CreatureIdentifierFromString("Angel")); - } - - [Test] - public void CreatureIdentifier_WhenValidValueIsPassed_ShouldReturnExpectedType() - { - // Act - var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); - - // Assert - Assert.IsInstanceOf(identifier); - } - - [Test] - public void CreatureIdentifier_WhenValidValueIsPassed_ShouldReturnExpectedCreatureType() - { - // Act - var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); - - // Assert - Assert.AreEqual("Angel", identifier.CreatureType); - } - - [Test] - public void CreatureIdentifier_WhenValidValueIsPassed_ShouldReturnExpectedArmyNumber() - { - // Act - var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); - - // Assert - Assert.AreEqual(1, identifier.ArmyNumber); - } - - [Test] - public void CreatureIdentifier_WhenValidValueIsPassed_ToStringShouldReturnExpectedString() - { - // Arrange - var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); - - // Act - var result = identifier.ToString(); - - // Assert - Assert.AreEqual("Angel(1)", result); - } - } -} +using System; +using ArmyOfCreatures.Logic.Battles; +using NUnit.Framework; + +namespace ArmyOfCreatures.Tests +{ + [TestFixture] + public class CreatureIdentifierTests + { + [Test] + public void CreatureIdentifier_WhenNullValueIsPassed_ShouldThrowArgumentNullException() + { + // Arrange, Act & Assert + Assert.Throws(() => CreatureIdentifier.CreatureIdentifierFromString(null)); + } + + [Test] + public void CreatureIdentifier_WhenInvalidValueToParseIntIsPassed_ShouldThrowArgumentNullException() + { + // Arrange, Act & Assert + Assert.Throws(() => CreatureIdentifier.CreatureIdentifierFromString("Angel(test)")); + } + + [Test] + public void CreatureIdentifier_WhenInvalidValueIsPassed_ShouldThrowIndexOutOfRangeException() + { + // Arrange, Act & Assert + Assert.Throws(() => CreatureIdentifier.CreatureIdentifierFromString("Angel")); + } + + [Test] + public void CreatureIdentifier_WhenValidValueIsPassed_ShouldReturnExpectedType() + { + // Act + var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); + + // Assert + Assert.IsInstanceOf(identifier); + } + + [Test] + public void CreatureIdentifier_WhenValidValueIsPassed_ShouldReturnExpectedCreatureType() + { + // Act + var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); + + // Assert + Assert.AreEqual("Angel", identifier.CreatureType); + } + + [Test] + public void CreatureIdentifier_WhenValidValueIsPassed_ShouldReturnExpectedArmyNumber() + { + // Act + var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); + + // Assert + Assert.AreEqual(1, identifier.ArmyNumber); + } + + [Test] + public void CreatureIdentifier_WhenValidValueIsPassed_ToStringShouldReturnExpectedString() + { + // Arrange + var identifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)"); + + // Act + var result = identifier.ToString(); + + // Assert + Assert.AreEqual("Angel(1)", result); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreaturesFactoryTests.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreaturesFactoryTests.cs similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreaturesFactoryTests.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreaturesFactoryTests.cs index 7ecf8df..d05222f 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreaturesFactoryTests.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/CreaturesFactoryTests.cs @@ -1,58 +1,58 @@ -using System; -using ArmyOfCreatures.Extended; -using ArmyOfCreatures.Logic.Creatures; -using NUnit.Framework; - -namespace ArmyOfCreatures.Tests -{ - [TestFixture] - public class CreaturesFactoryTests - { - [TestCase("Angel", typeof(Angel))] - [TestCase("Archangel", typeof(Archangel))] - [TestCase("ArchDevil", typeof(ArchDevil))] - [TestCase("Behemoth", typeof(Behemoth))] - [TestCase("Devil", typeof(Devil))] - public void CreaturesFactory_WhenValidNameIsPassed_ShouldReturnExpectedType(string name, Type expectedCreature) - { - // Arrange - var factory = new ExtendedCreaturesFactory(); - - // Act - var creature = factory.CreateCreature(name); - - // Assert - Assert.IsInstanceOf(expectedCreature.GetType(), creature.GetType()); - } - - [Test] - public void CreaturesFactory_WhenInValidNameIsPassed_ShouldThrowArgumentException() - { - // Arrange - var factory = new ExtendedCreaturesFactory(); - - // Act & Assert - Assert.Throws(() => factory.CreateCreature("Gosho")); - } - - [Test] - public void CreaturesFactory_WhenInValidNameIsPassed_ShouldThrowArgumentExceptionWithExpectedMessage() - { - // Arrange - var factory = new ExtendedCreaturesFactory(); - - // Act & Assert (method 1) - try - { - factory.CreateCreature("Gosho"); - } - catch (ArgumentException ex) - { - Assert.AreEqual($"Invalid creature type \"Gosho\"!", ex.Message); - } - - //// Act & Assert (method 2) - // Assert.That(()=>factory.CreateCreature("Gosho"), Throws.ArgumentException.With.Message.Contains($"Invalid creature type \"Gosho\"!")); - } - } -} +using System; +using ArmyOfCreatures.Extended; +using ArmyOfCreatures.Logic.Creatures; +using NUnit.Framework; + +namespace ArmyOfCreatures.Tests +{ + [TestFixture] + public class CreaturesFactoryTests + { + [TestCase("Angel", typeof(Angel))] + [TestCase("Archangel", typeof(Archangel))] + [TestCase("ArchDevil", typeof(ArchDevil))] + [TestCase("Behemoth", typeof(Behemoth))] + [TestCase("Devil", typeof(Devil))] + public void CreaturesFactory_WhenValidNameIsPassed_ShouldReturnExpectedType(string name, Type expectedCreature) + { + // Arrange + var factory = new ExtendedCreaturesFactory(); + + // Act + var creature = factory.CreateCreature(name); + + // Assert + Assert.IsInstanceOf(expectedCreature.GetType(), creature.GetType()); + } + + [Test] + public void CreaturesFactory_WhenInValidNameIsPassed_ShouldThrowArgumentException() + { + // Arrange + var factory = new ExtendedCreaturesFactory(); + + // Act & Assert + Assert.Throws(() => factory.CreateCreature("Gosho")); + } + + [Test] + public void CreaturesFactory_WhenInValidNameIsPassed_ShouldThrowArgumentExceptionWithExpectedMessage() + { + // Arrange + var factory = new ExtendedCreaturesFactory(); + + // Act & Assert (method 1) + try + { + factory.CreateCreature("Gosho"); + } + catch (ArgumentException ex) + { + Assert.AreEqual($"Invalid creature type \"Gosho\"!", ex.Message); + } + + //// Act & Assert (method 2) + // Assert.That(()=>factory.CreateCreature("Gosho"), Throws.ArgumentException.With.Message.Contains($"Invalid creature type \"Gosho\"!")); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/MockedClasses/MockedBattleManager.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/MockedClasses/MockedBattleManager.cs similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/MockedClasses/MockedBattleManager.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/MockedClasses/MockedBattleManager.cs index 116aa0e..5da4dcb 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/MockedClasses/MockedBattleManager.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/MockedClasses/MockedBattleManager.cs @@ -1,45 +1,45 @@ -using System.Collections.Generic; -using System.Linq; -using ArmyOfCreatures.Logic; -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Tests.MockedClasses -{ - public class MockedBattleManager : BattleManager - { - public MockedBattleManager(ICreaturesFactory factory, ILogger logger) - : base(factory, logger) - { - this.FirstArmyOfCreatures = new List(); - this.SecondArmyOfCreatures = new List(); - } - - public ICollection FirstArmyOfCreatures { get; set; } - - public ICollection SecondArmyOfCreatures { get; set; } - - protected override void AddCreaturesByIdentifier(CreatureIdentifier creatureIdentifier, ICreaturesInBattle creaturesInBattle) - { - if (creatureIdentifier.ArmyNumber == 1) - { - this.FirstArmyOfCreatures.Add(creaturesInBattle); - } - else if (creatureIdentifier.ArmyNumber == 2) - { - this.SecondArmyOfCreatures.Add(creaturesInBattle); - } - } - - protected override ICreaturesInBattle GetByIdentifier(CreatureIdentifier identifier) - { - if (identifier.ArmyNumber == 1) - { - return this.FirstArmyOfCreatures.FirstOrDefault(x => x.Creature.GetType().Name == identifier.CreatureType); - } - else - { - return this.SecondArmyOfCreatures.FirstOrDefault(x => x.Creature.GetType().Name == identifier.CreatureType); - } - } - } -} +using System.Collections.Generic; +using System.Linq; +using ArmyOfCreatures.Logic; +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Tests.MockedClasses +{ + public class MockedBattleManager : BattleManager + { + public MockedBattleManager(ICreaturesFactory factory, ILogger logger) + : base(factory, logger) + { + this.FirstArmyOfCreatures = new List(); + this.SecondArmyOfCreatures = new List(); + } + + public ICollection FirstArmyOfCreatures { get; set; } + + public ICollection SecondArmyOfCreatures { get; set; } + + protected override void AddCreaturesByIdentifier(CreatureIdentifier creatureIdentifier, ICreaturesInBattle creaturesInBattle) + { + if (creatureIdentifier.ArmyNumber == 1) + { + this.FirstArmyOfCreatures.Add(creaturesInBattle); + } + else if (creatureIdentifier.ArmyNumber == 2) + { + this.SecondArmyOfCreatures.Add(creaturesInBattle); + } + } + + protected override ICreaturesInBattle GetByIdentifier(CreatureIdentifier identifier) + { + if (identifier.ArmyNumber == 1) + { + return this.FirstArmyOfCreatures.FirstOrDefault(x => x.Creature.GetType().Name == identifier.CreatureType); + } + else + { + return this.SecondArmyOfCreatures.FirstOrDefault(x => x.Creature.GetType().Name == identifier.CreatureType); + } + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/Properties/AssemblyInfo.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/Properties/AssemblyInfo.cs similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/Properties/AssemblyInfo.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/Properties/AssemblyInfo.cs index b2abf72..4d1585f 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/Properties/AssemblyInfo.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/Properties/AssemblyInfo.cs @@ -1,35 +1,35 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ArmyOfCreatures.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ArmyOfCreatures.Tests")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2e8e9435-f4d8-413f-ba30-2dcd396063df")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ArmyOfCreatures.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ArmyOfCreatures.Tests")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2e8e9435-f4d8-413f-ba30-2dcd396063df")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/TestTest.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/TestTest.cs similarity index 93% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/TestTest.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/TestTest.cs index 0676951..4bae23a 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/TestTest.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/TestTest.cs @@ -1,12 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ArmyOfCreatures.Tests -{ - class TestTest - { - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ArmyOfCreatures.Tests +{ + class TestTest + { + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/packages.config b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/packages.config similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/packages.config rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/packages.config index 8e7240c..db42171 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/packages.config +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/packages.config @@ -1,9 +1,9 @@ - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.sln b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.sln similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.sln rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.sln index be4149e..69568d5 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.sln +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.sln @@ -1,28 +1,28 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArmyOfCreatures", "ArmyOfCreatures\ArmyOfCreatures.csproj", "{BB52E531-9691-46AF-9ED3-0EC7B011FBEC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArmyOfCreatures.Tests", "ArmyOfCreatures.Tests\ArmyOfCreatures.Tests.csproj", "{2E8E9435-F4D8-413F-BA30-2DCD396063DF}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BB52E531-9691-46AF-9ED3-0EC7B011FBEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB52E531-9691-46AF-9ED3-0EC7B011FBEC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB52E531-9691-46AF-9ED3-0EC7B011FBEC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB52E531-9691-46AF-9ED3-0EC7B011FBEC}.Release|Any CPU.Build.0 = Release|Any CPU - {2E8E9435-F4D8-413F-BA30-2DCD396063DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E8E9435-F4D8-413F-BA30-2DCD396063DF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E8E9435-F4D8-413F-BA30-2DCD396063DF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E8E9435-F4D8-413F-BA30-2DCD396063DF}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArmyOfCreatures", "ArmyOfCreatures\ArmyOfCreatures.csproj", "{BB52E531-9691-46AF-9ED3-0EC7B011FBEC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArmyOfCreatures.Tests", "ArmyOfCreatures.Tests\ArmyOfCreatures.Tests.csproj", "{2E8E9435-F4D8-413F-BA30-2DCD396063DF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BB52E531-9691-46AF-9ED3-0EC7B011FBEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB52E531-9691-46AF-9ED3-0EC7B011FBEC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB52E531-9691-46AF-9ED3-0EC7B011FBEC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB52E531-9691-46AF-9ED3-0EC7B011FBEC}.Release|Any CPU.Build.0 = Release|Any CPU + {2E8E9435-F4D8-413F-BA30-2DCD396063DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E8E9435-F4D8-413F-BA30-2DCD396063DF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E8E9435-F4D8-413F-BA30-2DCD396063DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E8E9435-F4D8-413F-BA30-2DCD396063DF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/App.config b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/App.config similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/App.config rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/App.config diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/ArmyOfCreatures.csproj b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/ArmyOfCreatures.csproj similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/ArmyOfCreatures.csproj rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/ArmyOfCreatures.csproj index f1d4e24..4b6f757 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/ArmyOfCreatures.csproj +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/ArmyOfCreatures.csproj @@ -1,97 +1,97 @@ - - - - - Debug - AnyCPU - {BB52E531-9691-46AF-9ED3-0EC7B011FBEC} - Exe - Properties - ArmyOfCreatures - ArmyOfCreatures - v4.5 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + AnyCPU + {BB52E531-9691-46AF-9ED3-0EC7B011FBEC} + Exe + Properties + ArmyOfCreatures + ArmyOfCreatures + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AddCommand.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AddCommand.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AddCommand.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AddCommand.cs index 7d634c0..0c5e47c 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AddCommand.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AddCommand.cs @@ -1,34 +1,34 @@ -using System; -using System.Globalization; - -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Console.Commands -{ - public class AddCommand : ICommand - { - public void ProcessCommand(IBattleManager battleManager, params string[] arguments) - { - if (battleManager == null) - { - throw new ArgumentNullException("battleManager"); - } - - if (arguments == null) - { - throw new ArgumentNullException("arguments"); - } - - if (arguments.Length < 2) - { - throw new ArgumentException("Invalid number of arguments for add command"); - } - - var count = int.Parse(arguments[0], CultureInfo.InvariantCulture); - var creatureIdentifierString = arguments[1]; - var creatureIdentifier = CreatureIdentifier.CreatureIdentifierFromString(creatureIdentifierString); - - battleManager.AddCreatures(creatureIdentifier, count); - } - } -} +using System; +using System.Globalization; + +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Console.Commands +{ + public class AddCommand : ICommand + { + public void ProcessCommand(IBattleManager battleManager, params string[] arguments) + { + if (battleManager == null) + { + throw new ArgumentNullException("battleManager"); + } + + if (arguments == null) + { + throw new ArgumentNullException("arguments"); + } + + if (arguments.Length < 2) + { + throw new ArgumentException("Invalid number of arguments for add command"); + } + + var count = int.Parse(arguments[0], CultureInfo.InvariantCulture); + var creatureIdentifierString = arguments[1]; + var creatureIdentifier = CreatureIdentifier.CreatureIdentifierFromString(creatureIdentifierString); + + battleManager.AddCreatures(creatureIdentifier, count); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AttackCommand.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AttackCommand.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AttackCommand.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AttackCommand.cs index 8234cdc..68a109b 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AttackCommand.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/AttackCommand.cs @@ -1,35 +1,35 @@ -using System; - -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Console.Commands -{ - public class AttackCommand : ICommand - { - public void ProcessCommand(IBattleManager battleManager, params string[] arguments) - { - if (battleManager == null) - { - throw new ArgumentNullException("battleManager"); - } - - if (arguments == null) - { - throw new ArgumentNullException("arguments"); - } - - if (arguments.Length < 2) - { - throw new ArgumentException("Invalid number of arguments for attack command"); - } - - var attackerIdentifierString = arguments[0]; - var attackerIdentifier = CreatureIdentifier.CreatureIdentifierFromString(attackerIdentifierString); - - var defenderIdentifierString = arguments[1]; - var defenderIdentifier = CreatureIdentifier.CreatureIdentifierFromString(defenderIdentifierString); - - battleManager.Attack(attackerIdentifier, defenderIdentifier); - } - } -} +using System; + +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Console.Commands +{ + public class AttackCommand : ICommand + { + public void ProcessCommand(IBattleManager battleManager, params string[] arguments) + { + if (battleManager == null) + { + throw new ArgumentNullException("battleManager"); + } + + if (arguments == null) + { + throw new ArgumentNullException("arguments"); + } + + if (arguments.Length < 2) + { + throw new ArgumentException("Invalid number of arguments for attack command"); + } + + var attackerIdentifierString = arguments[0]; + var attackerIdentifier = CreatureIdentifier.CreatureIdentifierFromString(attackerIdentifierString); + + var defenderIdentifierString = arguments[1]; + var defenderIdentifier = CreatureIdentifier.CreatureIdentifierFromString(defenderIdentifierString); + + battleManager.Attack(attackerIdentifier, defenderIdentifier); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/CommandManager.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/CommandManager.cs similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/CommandManager.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/CommandManager.cs index 55310c7..698f084 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/CommandManager.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/CommandManager.cs @@ -1,41 +1,41 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; - -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Console.Commands -{ - public class CommandManager : ICommandManager - { - private readonly Dictionary commands = - new Dictionary - { - { "add", new AddCommand() }, - { "attack", new AttackCommand() }, - { "skip", new SkipCommand() }, - { "exit", new ExitCommand() } - }; - - public void ProcessCommand(string commandLine, IBattleManager battleManager) - { - if (commandLine == null) - { - throw new ArgumentNullException("commandLine"); - } - - var commandParts = commandLine.Split(' '); - var commandName = commandParts[0]; - if (!this.commands.ContainsKey(commandName)) - { - throw new ArgumentException( - string.Format(CultureInfo.InvariantCulture, "Invalid command name \"{0}\"", commandName)); - } - - var command = this.commands[commandName]; - var commandArguments = commandParts.Skip(1).ToArray(); - command.ProcessCommand(battleManager, commandArguments); - } - } -} +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; + +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Console.Commands +{ + public class CommandManager : ICommandManager + { + private readonly Dictionary commands = + new Dictionary + { + { "add", new AddCommand() }, + { "attack", new AttackCommand() }, + { "skip", new SkipCommand() }, + { "exit", new ExitCommand() } + }; + + public void ProcessCommand(string commandLine, IBattleManager battleManager) + { + if (commandLine == null) + { + throw new ArgumentNullException("commandLine"); + } + + var commandParts = commandLine.Split(' '); + var commandName = commandParts[0]; + if (!this.commands.ContainsKey(commandName)) + { + throw new ArgumentException( + string.Format(CultureInfo.InvariantCulture, "Invalid command name \"{0}\"", commandName)); + } + + var command = this.commands[commandName]; + var commandArguments = commandParts.Skip(1).ToArray(); + command.ProcessCommand(battleManager, commandArguments); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ExitCommand.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ExitCommand.cs similarity index 95% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ExitCommand.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ExitCommand.cs index e5074ea..ef8748b 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ExitCommand.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ExitCommand.cs @@ -1,14 +1,14 @@ -using System; - -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Console.Commands -{ - public class ExitCommand : ICommand - { - public void ProcessCommand(IBattleManager battleManager, params string[] arguments) - { - Environment.Exit(0); - } - } -} +using System; + +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Console.Commands +{ + public class ExitCommand : ICommand + { + public void ProcessCommand(IBattleManager battleManager, params string[] arguments) + { + Environment.Exit(0); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommand.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommand.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommand.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommand.cs index ead3a48..8cc90ff 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommand.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommand.cs @@ -1,9 +1,9 @@ -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Console.Commands -{ - public interface ICommand - { - void ProcessCommand(IBattleManager battleManager, params string[] arguments); - } -} +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Console.Commands +{ + public interface ICommand + { + void ProcessCommand(IBattleManager battleManager, params string[] arguments); + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommandManager.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommandManager.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommandManager.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommandManager.cs index 2dc55bb..053d335 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommandManager.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommandManager.cs @@ -1,9 +1,9 @@ -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Console.Commands -{ - public interface ICommandManager - { - void ProcessCommand(string commandLine, IBattleManager battleManager); - } +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Console.Commands +{ + public interface ICommandManager + { + void ProcessCommand(string commandLine, IBattleManager battleManager); + } } \ No newline at end of file diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/SkipCommand.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/SkipCommand.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/SkipCommand.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/SkipCommand.cs index 23fb130..c812309 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/SkipCommand.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/SkipCommand.cs @@ -1,32 +1,32 @@ -using System; - -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Console.Commands -{ - public class SkipCommand : ICommand - { - public void ProcessCommand(IBattleManager battleManager, params string[] arguments) - { - if (battleManager == null) - { - throw new ArgumentNullException("battleManager"); - } - - if (arguments == null) - { - throw new ArgumentNullException("arguments"); - } - - if (arguments.Length < 1) - { - throw new ArgumentException("Invalid number of arguments for skip command"); - } - - var creatureIdentifierString = arguments[0]; - var creatureIdentifier = CreatureIdentifier.CreatureIdentifierFromString(creatureIdentifierString); - - battleManager.Skip(creatureIdentifier); - } - } -} +using System; + +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Console.Commands +{ + public class SkipCommand : ICommand + { + public void ProcessCommand(IBattleManager battleManager, params string[] arguments) + { + if (battleManager == null) + { + throw new ArgumentNullException("battleManager"); + } + + if (arguments == null) + { + throw new ArgumentNullException("arguments"); + } + + if (arguments.Length < 1) + { + throw new ArgumentException("Invalid number of arguments for skip command"); + } + + var creatureIdentifierString = arguments[0]; + var creatureIdentifier = CreatureIdentifier.CreatureIdentifierFromString(creatureIdentifierString); + + battleManager.Skip(creatureIdentifier); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/ConsoleWriter.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/ConsoleWriter.cs similarity index 95% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/ConsoleWriter.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/ConsoleWriter.cs index 801ed48..a4e4821 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/ConsoleWriter.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/ConsoleWriter.cs @@ -1,12 +1,12 @@ -using ArmyOfCreatures.Logic; - -namespace ArmyOfCreatures.Console -{ - public class ConsoleLogger : ILogger - { - public void WriteLine(string line) - { - System.Console.WriteLine(line); - } - } -} +using ArmyOfCreatures.Logic; + +namespace ArmyOfCreatures.Console +{ + public class ConsoleLogger : ILogger + { + public void WriteLine(string line) + { + System.Console.WriteLine(line); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Program.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Program.cs similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Program.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Program.cs index b99475a..5c41930 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Program.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Program.cs @@ -1,43 +1,43 @@ -using System.Globalization; -using System.Threading; - -using ArmyOfCreatures.Console.Commands; -using ArmyOfCreatures.Extended; -using ArmyOfCreatures.Logic; -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Console -{ - // No comments for you! It was hard to write so it should be hard to read. - public static class Program - { - public static void Main() - { - Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; - - ICreaturesFactory creaturesFactory = GetCreaturesFactory(); - ILogger logger = new ConsoleLogger(); - IBattleManager battleManager = GetBattleManager(creaturesFactory, logger); - - // Process commands - ICommandManager commandManager = new CommandManager(); - while (true) - { - var commandLine = System.Console.ReadLine(); - commandManager.ProcessCommand(commandLine, battleManager); - } - } - - private static IBattleManager GetBattleManager(ICreaturesFactory creaturesFactory, ILogger logger) - { - // You are allowed to add, change and remove code here - return new BattleManagerWithThreeArmies(creaturesFactory, logger); - } - - private static ICreaturesFactory GetCreaturesFactory() - { - // You are allowed to add, change and remove code here - return new ExtendedCreaturesFactory(); - } - } -} +using System.Globalization; +using System.Threading; + +using ArmyOfCreatures.Console.Commands; +using ArmyOfCreatures.Extended; +using ArmyOfCreatures.Logic; +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Console +{ + // No comments for you! It was hard to write so it should be hard to read. + public static class Program + { + public static void Main() + { + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; + + ICreaturesFactory creaturesFactory = GetCreaturesFactory(); + ILogger logger = new ConsoleLogger(); + IBattleManager battleManager = GetBattleManager(creaturesFactory, logger); + + // Process commands + ICommandManager commandManager = new CommandManager(); + while (true) + { + var commandLine = System.Console.ReadLine(); + commandManager.ProcessCommand(commandLine, battleManager); + } + } + + private static IBattleManager GetBattleManager(ICreaturesFactory creaturesFactory, ILogger logger) + { + // You are allowed to add, change and remove code here + return new BattleManagerWithThreeArmies(creaturesFactory, logger); + } + + private static ICreaturesFactory GetCreaturesFactory() + { + // You are allowed to add, change and remove code here + return new ExtendedCreaturesFactory(); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/BattleManagerWithThreeArmies.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/BattleManagerWithThreeArmies.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/BattleManagerWithThreeArmies.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/BattleManagerWithThreeArmies.cs diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs index d54f10a..826ed75 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs @@ -1,15 +1,15 @@ -using ArmyOfCreatures.Logic.Creatures; -using ArmyOfCreatures.Logic.Specialties; - -namespace ArmyOfCreatures.Extended.Creatures -{ - public class AncientBehemoth : Creature - { - public AncientBehemoth() - : base(19, 19, 300, 40M) - { - this.AddSpecialty(new ReduceEnemyDefenseByPercentage(80)); - this.AddSpecialty(new DoubleDefenseWhenDefending(5)); - } - } -} +using ArmyOfCreatures.Logic.Creatures; +using ArmyOfCreatures.Logic.Specialties; + +namespace ArmyOfCreatures.Extended.Creatures +{ + public class AncientBehemoth : Creature + { + public AncientBehemoth() + : base(19, 19, 300, 40M) + { + this.AddSpecialty(new ReduceEnemyDefenseByPercentage(80)); + this.AddSpecialty(new DoubleDefenseWhenDefending(5)); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs index 4709d95..2663e38 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs @@ -1,16 +1,16 @@ -using ArmyOfCreatures.Extended.Specialties; -using ArmyOfCreatures.Logic.Creatures; - -namespace ArmyOfCreatures.Extended.Creatures -{ - public class CyclopsKing : Creature - { - public CyclopsKing() - : base(17, 13, 70, 18) - { - this.AddSpecialty(new AddAttackWhenSkip(3)); - this.AddSpecialty(new DoubleAttackWhenAttacking(4)); - this.AddSpecialty(new DoubleDamage(1)); - } - } -} +using ArmyOfCreatures.Extended.Specialties; +using ArmyOfCreatures.Logic.Creatures; + +namespace ArmyOfCreatures.Extended.Creatures +{ + public class CyclopsKing : Creature + { + public CyclopsKing() + : base(17, 13, 70, 18) + { + this.AddSpecialty(new AddAttackWhenSkip(3)); + this.AddSpecialty(new DoubleAttackWhenAttacking(4)); + this.AddSpecialty(new DoubleDamage(1)); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Goblin.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Goblin.cs similarity index 94% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Goblin.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Goblin.cs index 9fa07ea..ac96884 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Goblin.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Goblin.cs @@ -1,12 +1,12 @@ -using ArmyOfCreatures.Logic.Creatures; - -namespace ArmyOfCreatures.Extended.Creatures -{ - public class Goblin : Creature - { - public Goblin() - : base(4, 2, 5, 1.5M) - { - } - } -} +using ArmyOfCreatures.Logic.Creatures; + +namespace ArmyOfCreatures.Extended.Creatures +{ + public class Goblin : Creature + { + public Goblin() + : base(4, 2, 5, 1.5M) + { + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Griffin.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Griffin.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Griffin.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Griffin.cs index ab20ae2..8593731 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Griffin.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Griffin.cs @@ -1,16 +1,16 @@ -using ArmyOfCreatures.Logic.Creatures; -using ArmyOfCreatures.Logic.Specialties; - -namespace ArmyOfCreatures.Extended.Creatures -{ - public class Griffin : Creature - { - public Griffin() - : base(8, 8, 25, 4.5M) - { - this.AddSpecialty(new DoubleDefenseWhenDefending(5)); - this.AddSpecialty(new AddDefenseWhenSkip(3)); - this.AddSpecialty(new Hate(typeof(WolfRaider))); - } - } -} +using ArmyOfCreatures.Logic.Creatures; +using ArmyOfCreatures.Logic.Specialties; + +namespace ArmyOfCreatures.Extended.Creatures +{ + public class Griffin : Creature + { + public Griffin() + : base(8, 8, 25, 4.5M) + { + this.AddSpecialty(new DoubleDefenseWhenDefending(5)); + this.AddSpecialty(new AddDefenseWhenSkip(3)); + this.AddSpecialty(new Hate(typeof(WolfRaider))); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs similarity index 95% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs index e967a75..5a91b77 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs @@ -1,14 +1,14 @@ -using ArmyOfCreatures.Extended.Specialties; -using ArmyOfCreatures.Logic.Creatures; - -namespace ArmyOfCreatures.Extended.Creatures -{ - public class WolfRaider : Creature - { - public WolfRaider() - : base(8, 5, 10, 3.5M) - { - this.AddSpecialty(new DoubleDamage(7)); - } - } -} +using ArmyOfCreatures.Extended.Specialties; +using ArmyOfCreatures.Logic.Creatures; + +namespace ArmyOfCreatures.Extended.Creatures +{ + public class WolfRaider : Creature + { + public WolfRaider() + : base(8, 5, 10, 3.5M) + { + this.AddSpecialty(new DoubleDamage(7)); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/ExtendedCreaturesFactory.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/ExtendedCreaturesFactory.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/ExtendedCreaturesFactory.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/ExtendedCreaturesFactory.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/AddAttackWhenSkip.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/AddAttackWhenSkip.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/AddAttackWhenSkip.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/AddAttackWhenSkip.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/DoubleAttackWhenAttacking.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/DoubleAttackWhenAttacking.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/DoubleAttackWhenAttacking.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/DoubleAttackWhenAttacking.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/DoubleDamage.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/DoubleDamage.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/DoubleDamage.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/DoubleDamage.cs diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/BattleManager.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/BattleManager.cs similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/BattleManager.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/BattleManager.cs index 977f72e..fe970c9 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/BattleManager.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/BattleManager.cs @@ -1,171 +1,171 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; - -namespace ArmyOfCreatures.Logic.Battles -{ - public class BattleManager : IBattleManager - { - private const string LogFormat = "--- {0} - {1}"; - - private readonly ICollection firstArmyCreatures; - - private readonly ICollection secondArmyCreatures; - - private readonly ICreaturesFactory creaturesFactory; - - private readonly ILogger logger; - - public BattleManager(ICreaturesFactory creaturesFactory, ILogger logger) - { - this.firstArmyCreatures = new List(); - this.secondArmyCreatures = new List(); - this.creaturesFactory = creaturesFactory; - this.logger = logger; - } - - public ICreaturesFactory CreaturesFactory - { - get { return this.creaturesFactory; } - } - - public void AddCreatures(CreatureIdentifier creatureIdentifier, int count) - { - if (creatureIdentifier == null) - { - throw new ArgumentNullException("creatureIdentifier"); - } - - var creature = this.creaturesFactory.CreateCreature(creatureIdentifier.CreatureType); - var creaturesInBattle = new CreaturesInBattle(creature, count); - this.AddCreaturesByIdentifier(creatureIdentifier, creaturesInBattle); - - this.logger.WriteLine( - string.Format( - CultureInfo.InvariantCulture, - LogFormat, - string.Format(CultureInfo.InvariantCulture, "Creature added to army {0}", creatureIdentifier.ArmyNumber), - creature)); - } - - public void Attack(CreatureIdentifier attackerIdentifier, CreatureIdentifier defenderIdentifier) - { - var attackerCreature = this.GetByIdentifier(attackerIdentifier); - if (attackerCreature == null) - { - throw new ArgumentException( - string.Format(CultureInfo.InvariantCulture, "Attacker not found: {0}", attackerIdentifier)); - } - - var defenderCreature = this.GetByIdentifier(defenderIdentifier); - if (defenderCreature == null) - { - throw new ArgumentException( - string.Format(CultureInfo.InvariantCulture, "Defender not found: {0}", defenderIdentifier)); - } - - attackerCreature.StartNewTurn(); - defenderCreature.StartNewTurn(); - - this.logger.WriteLine(string.Format(CultureInfo.InvariantCulture, LogFormat, "Attacker before", attackerCreature)); - this.logger.WriteLine(string.Format(CultureInfo.InvariantCulture, LogFormat, "Defender before", defenderCreature)); - - // Call ApplyWhenAttacking on attacker - foreach (var speciallity in attackerCreature.Creature.Specialties) - { - speciallity.ApplyWhenAttacking(attackerCreature, defenderCreature); - } - - // Call ApplyWhenDefending on defender - foreach (var speciallity in defenderCreature.Creature.Specialties) - { - speciallity.ApplyWhenDefending(defenderCreature, attackerCreature); - } - - // Call ChangeDamage on attacker - attackerCreature.DealDamage(defenderCreature); - - // Call ApplyAfterDefending on defender - foreach (var speciallity in defenderCreature.Creature.Specialties) - { - speciallity.ApplyAfterDefending(defenderCreature); - } - - if (attackerIdentifier.ArmyNumber == defenderIdentifier.ArmyNumber) - { - throw new ArgumentException(); - } - - this.logger.WriteLine(string.Format(CultureInfo.InvariantCulture, LogFormat, "Attacker after", attackerCreature)); - this.logger.WriteLine(string.Format(CultureInfo.InvariantCulture, LogFormat, "Defender after", defenderCreature)); - } - - public void Skip(CreatureIdentifier creatureIdentifier) - { - var creature = this.GetByIdentifier(creatureIdentifier); - if (creature == null) - { - throw new ArgumentException( - string.Format(CultureInfo.InvariantCulture, "Skip creature not found: {0}", creatureIdentifier)); - } - - creature.StartNewTurn(); - - this.logger.WriteLine(string.Format(CultureInfo.InvariantCulture, LogFormat, "Before skip", creature)); - - creature.Skip(); - creature.StartNewTurn(); - - this.logger.WriteLine(string.Format(CultureInfo.InvariantCulture, LogFormat, "After skip", creature)); - } - - protected virtual void AddCreaturesByIdentifier(CreatureIdentifier creatureIdentifier, ICreaturesInBattle creaturesInBattle) - { - if (creatureIdentifier == null) - { - throw new ArgumentNullException("creatureIdentifier"); - } - - if (creaturesInBattle == null) - { - throw new ArgumentNullException("creaturesInBattle"); - } - - if (creatureIdentifier.ArmyNumber == 1) - { - this.firstArmyCreatures.Add(creaturesInBattle); - } - else if (creatureIdentifier.ArmyNumber == 2) - { - this.secondArmyCreatures.Add(creaturesInBattle); - } - else - { - throw new ArgumentException( - string.Format(CultureInfo.InvariantCulture, "Invalid ArmyNumber: {0}", creatureIdentifier.ArmyNumber)); - } - } - - protected virtual ICreaturesInBattle GetByIdentifier(CreatureIdentifier identifier) - { - if (identifier == null) - { - throw new ArgumentNullException("identifier"); - } - - if (identifier.ArmyNumber == 1) - { - return this.firstArmyCreatures.FirstOrDefault(x => x.Creature.GetType().Name == identifier.CreatureType); - } - - if (identifier.ArmyNumber == 2) - { - return this.secondArmyCreatures.FirstOrDefault(x => x.Creature.GetType().Name == identifier.CreatureType); - } - - throw new ArgumentException( - string.Format(CultureInfo.InvariantCulture, "Invalid ArmyNumber: {0}", identifier.ArmyNumber)); - } - } -} +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; + +namespace ArmyOfCreatures.Logic.Battles +{ + public class BattleManager : IBattleManager + { + private const string LogFormat = "--- {0} - {1}"; + + private readonly ICollection firstArmyCreatures; + + private readonly ICollection secondArmyCreatures; + + private readonly ICreaturesFactory creaturesFactory; + + private readonly ILogger logger; + + public BattleManager(ICreaturesFactory creaturesFactory, ILogger logger) + { + this.firstArmyCreatures = new List(); + this.secondArmyCreatures = new List(); + this.creaturesFactory = creaturesFactory; + this.logger = logger; + } + + public ICreaturesFactory CreaturesFactory + { + get { return this.creaturesFactory; } + } + + public void AddCreatures(CreatureIdentifier creatureIdentifier, int count) + { + if (creatureIdentifier == null) + { + throw new ArgumentNullException("creatureIdentifier"); + } + + var creature = this.creaturesFactory.CreateCreature(creatureIdentifier.CreatureType); + var creaturesInBattle = new CreaturesInBattle(creature, count); + this.AddCreaturesByIdentifier(creatureIdentifier, creaturesInBattle); + + this.logger.WriteLine( + string.Format( + CultureInfo.InvariantCulture, + LogFormat, + string.Format(CultureInfo.InvariantCulture, "Creature added to army {0}", creatureIdentifier.ArmyNumber), + creature)); + } + + public void Attack(CreatureIdentifier attackerIdentifier, CreatureIdentifier defenderIdentifier) + { + var attackerCreature = this.GetByIdentifier(attackerIdentifier); + if (attackerCreature == null) + { + throw new ArgumentException( + string.Format(CultureInfo.InvariantCulture, "Attacker not found: {0}", attackerIdentifier)); + } + + var defenderCreature = this.GetByIdentifier(defenderIdentifier); + if (defenderCreature == null) + { + throw new ArgumentException( + string.Format(CultureInfo.InvariantCulture, "Defender not found: {0}", defenderIdentifier)); + } + + attackerCreature.StartNewTurn(); + defenderCreature.StartNewTurn(); + + this.logger.WriteLine(string.Format(CultureInfo.InvariantCulture, LogFormat, "Attacker before", attackerCreature)); + this.logger.WriteLine(string.Format(CultureInfo.InvariantCulture, LogFormat, "Defender before", defenderCreature)); + + // Call ApplyWhenAttacking on attacker + foreach (var speciallity in attackerCreature.Creature.Specialties) + { + speciallity.ApplyWhenAttacking(attackerCreature, defenderCreature); + } + + // Call ApplyWhenDefending on defender + foreach (var speciallity in defenderCreature.Creature.Specialties) + { + speciallity.ApplyWhenDefending(defenderCreature, attackerCreature); + } + + // Call ChangeDamage on attacker + attackerCreature.DealDamage(defenderCreature); + + // Call ApplyAfterDefending on defender + foreach (var speciallity in defenderCreature.Creature.Specialties) + { + speciallity.ApplyAfterDefending(defenderCreature); + } + + if (attackerIdentifier.ArmyNumber == defenderIdentifier.ArmyNumber) + { + throw new ArgumentException(); + } + + this.logger.WriteLine(string.Format(CultureInfo.InvariantCulture, LogFormat, "Attacker after", attackerCreature)); + this.logger.WriteLine(string.Format(CultureInfo.InvariantCulture, LogFormat, "Defender after", defenderCreature)); + } + + public void Skip(CreatureIdentifier creatureIdentifier) + { + var creature = this.GetByIdentifier(creatureIdentifier); + if (creature == null) + { + throw new ArgumentException( + string.Format(CultureInfo.InvariantCulture, "Skip creature not found: {0}", creatureIdentifier)); + } + + creature.StartNewTurn(); + + this.logger.WriteLine(string.Format(CultureInfo.InvariantCulture, LogFormat, "Before skip", creature)); + + creature.Skip(); + creature.StartNewTurn(); + + this.logger.WriteLine(string.Format(CultureInfo.InvariantCulture, LogFormat, "After skip", creature)); + } + + protected virtual void AddCreaturesByIdentifier(CreatureIdentifier creatureIdentifier, ICreaturesInBattle creaturesInBattle) + { + if (creatureIdentifier == null) + { + throw new ArgumentNullException("creatureIdentifier"); + } + + if (creaturesInBattle == null) + { + throw new ArgumentNullException("creaturesInBattle"); + } + + if (creatureIdentifier.ArmyNumber == 1) + { + this.firstArmyCreatures.Add(creaturesInBattle); + } + else if (creatureIdentifier.ArmyNumber == 2) + { + this.secondArmyCreatures.Add(creaturesInBattle); + } + else + { + throw new ArgumentException( + string.Format(CultureInfo.InvariantCulture, "Invalid ArmyNumber: {0}", creatureIdentifier.ArmyNumber)); + } + } + + protected virtual ICreaturesInBattle GetByIdentifier(CreatureIdentifier identifier) + { + if (identifier == null) + { + throw new ArgumentNullException("identifier"); + } + + if (identifier.ArmyNumber == 1) + { + return this.firstArmyCreatures.FirstOrDefault(x => x.Creature.GetType().Name == identifier.CreatureType); + } + + if (identifier.ArmyNumber == 2) + { + return this.secondArmyCreatures.FirstOrDefault(x => x.Creature.GetType().Name == identifier.CreatureType); + } + + throw new ArgumentException( + string.Format(CultureInfo.InvariantCulture, "Invalid ArmyNumber: {0}", identifier.ArmyNumber)); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreatureIdentifier.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreatureIdentifier.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreatureIdentifier.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreatureIdentifier.cs index 7c921fa..1663751 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreatureIdentifier.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreatureIdentifier.cs @@ -1,38 +1,38 @@ -using System; -using System.Globalization; - -namespace ArmyOfCreatures.Logic.Battles -{ - public sealed class CreatureIdentifier - { - private CreatureIdentifier(string creatureType, int armyNumber) - { - this.CreatureType = creatureType; - this.ArmyNumber = armyNumber; - } - - public string CreatureType { get; private set; } - - public int ArmyNumber { get; private set; } - - public static CreatureIdentifier CreatureIdentifierFromString(string valueToParse) - { - if (valueToParse == null) - { - throw new ArgumentNullException("valueToParse"); - } - - var stringParts = valueToParse.Split('('); - - var creatureType = stringParts[0]; - var armyNumber = int.Parse(stringParts[1].Trim('(', ')'), CultureInfo.InvariantCulture); - - return new CreatureIdentifier(creatureType, armyNumber); - } - - public override string ToString() - { - return string.Format(CultureInfo.InvariantCulture, "{0}({1})", this.CreatureType, this.ArmyNumber); - } - } -} +using System; +using System.Globalization; + +namespace ArmyOfCreatures.Logic.Battles +{ + public sealed class CreatureIdentifier + { + private CreatureIdentifier(string creatureType, int armyNumber) + { + this.CreatureType = creatureType; + this.ArmyNumber = armyNumber; + } + + public string CreatureType { get; private set; } + + public int ArmyNumber { get; private set; } + + public static CreatureIdentifier CreatureIdentifierFromString(string valueToParse) + { + if (valueToParse == null) + { + throw new ArgumentNullException("valueToParse"); + } + + var stringParts = valueToParse.Split('('); + + var creatureType = stringParts[0]; + var armyNumber = int.Parse(stringParts[1].Trim('(', ')'), CultureInfo.InvariantCulture); + + return new CreatureIdentifier(creatureType, armyNumber); + } + + public override string ToString() + { + return string.Format(CultureInfo.InvariantCulture, "{0}({1})", this.CreatureType, this.ArmyNumber); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreaturesInBattle.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreaturesInBattle.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreaturesInBattle.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreaturesInBattle.cs index 05ef159..375d337 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreaturesInBattle.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/CreaturesInBattle.cs @@ -1,137 +1,137 @@ -using System; -using System.Globalization; - -using ArmyOfCreatures.Logic.Creatures; - -namespace ArmyOfCreatures.Logic.Battles -{ - public sealed class CreaturesInBattle : ICreaturesInBattle - { - private decimal lastDamage; - - private int totalHitPoints; - - internal CreaturesInBattle(Creature creature, int count) - { - this.Creature = creature; - this.PermanentAttack = creature.Attack; - this.PermanentDefense = creature.Defense; - this.TotalHitPoints = creature.HealthPoints * count; - this.StartNewTurn(); - } - - public Creature Creature { get; private set; } - - public int CurrentAttack { get; set; } - - public int PermanentAttack { get; set; } - - public int CurrentDefense { get; set; } - - public int PermanentDefense { get; set; } - - public int TotalHitPoints - { - get - { - if (this.totalHitPoints < 0) - { - return 0; - } - - return this.totalHitPoints; - } - - set - { - this.totalHitPoints = value; - } - } - - public int Count - { - get - { - var count = (int)Math.Ceiling((double)this.TotalHitPoints / this.Creature.HealthPoints); - if (count < 0) - { - return 0; - } - - return count; - } - } - - public void DealDamage(ICreaturesInBattle defender) - { - if (defender == null) - { - throw new ArgumentNullException("defender"); - } - - // Calculate bonus for damage - decimal attackBonus = 1.00M; // Initially 100% - if (this.CurrentAttack > defender.CurrentDefense) - { - attackBonus += 0.05M * (this.CurrentAttack - defender.CurrentDefense); - } - - // Calculate damage - decimal damageToMake = this.Creature.Damage * this.Count; - damageToMake = damageToMake * attackBonus; - - // Apply battle effects for damage (ChangeDamageWhenAttacking) - foreach (var speciallity in this.Creature.Specialties) - { - damageToMake = speciallity.ChangeDamageWhenAttacking(this, defender, damageToMake); - } - - // Calculate damage reductions - if (defender.CurrentDefense > this.CurrentAttack) - { - decimal reduceDamage = 0.025M * (defender.CurrentDefense - this.CurrentAttack); - if (reduceDamage > 0.7M) - { - reduceDamage = 0.7M; - } - - damageToMake = damageToMake * (1M - reduceDamage); - } - - this.lastDamage = damageToMake; - defender.TotalHitPoints -= (int)damageToMake; - } - - public void Skip() - { - // Skipping adds 3 permanent defense for the creature - this.PermanentDefense += 3; - - // Call ApplyOnSkip on creature - foreach (var speciallity in this.Creature.Specialties) - { - speciallity.ApplyOnSkip(this); - } - } - - public void StartNewTurn() - { - this.CurrentAttack = this.PermanentAttack; - this.CurrentDefense = this.PermanentDefense; - this.lastDamage = 0; - } - - public override string ToString() - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} (ATT:{2}; DEF:{3}; THP:{4}; LDMG:{5:0.####})", - this.Count, - this.Creature.GetType().Name, - this.CurrentAttack, - this.CurrentDefense, - this.TotalHitPoints, - this.lastDamage); - } - } -} +using System; +using System.Globalization; + +using ArmyOfCreatures.Logic.Creatures; + +namespace ArmyOfCreatures.Logic.Battles +{ + public sealed class CreaturesInBattle : ICreaturesInBattle + { + private decimal lastDamage; + + private int totalHitPoints; + + internal CreaturesInBattle(Creature creature, int count) + { + this.Creature = creature; + this.PermanentAttack = creature.Attack; + this.PermanentDefense = creature.Defense; + this.TotalHitPoints = creature.HealthPoints * count; + this.StartNewTurn(); + } + + public Creature Creature { get; private set; } + + public int CurrentAttack { get; set; } + + public int PermanentAttack { get; set; } + + public int CurrentDefense { get; set; } + + public int PermanentDefense { get; set; } + + public int TotalHitPoints + { + get + { + if (this.totalHitPoints < 0) + { + return 0; + } + + return this.totalHitPoints; + } + + set + { + this.totalHitPoints = value; + } + } + + public int Count + { + get + { + var count = (int)Math.Ceiling((double)this.TotalHitPoints / this.Creature.HealthPoints); + if (count < 0) + { + return 0; + } + + return count; + } + } + + public void DealDamage(ICreaturesInBattle defender) + { + if (defender == null) + { + throw new ArgumentNullException("defender"); + } + + // Calculate bonus for damage + decimal attackBonus = 1.00M; // Initially 100% + if (this.CurrentAttack > defender.CurrentDefense) + { + attackBonus += 0.05M * (this.CurrentAttack - defender.CurrentDefense); + } + + // Calculate damage + decimal damageToMake = this.Creature.Damage * this.Count; + damageToMake = damageToMake * attackBonus; + + // Apply battle effects for damage (ChangeDamageWhenAttacking) + foreach (var speciallity in this.Creature.Specialties) + { + damageToMake = speciallity.ChangeDamageWhenAttacking(this, defender, damageToMake); + } + + // Calculate damage reductions + if (defender.CurrentDefense > this.CurrentAttack) + { + decimal reduceDamage = 0.025M * (defender.CurrentDefense - this.CurrentAttack); + if (reduceDamage > 0.7M) + { + reduceDamage = 0.7M; + } + + damageToMake = damageToMake * (1M - reduceDamage); + } + + this.lastDamage = damageToMake; + defender.TotalHitPoints -= (int)damageToMake; + } + + public void Skip() + { + // Skipping adds 3 permanent defense for the creature + this.PermanentDefense += 3; + + // Call ApplyOnSkip on creature + foreach (var speciallity in this.Creature.Specialties) + { + speciallity.ApplyOnSkip(this); + } + } + + public void StartNewTurn() + { + this.CurrentAttack = this.PermanentAttack; + this.CurrentDefense = this.PermanentDefense; + this.lastDamage = 0; + } + + public override string ToString() + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} (ATT:{2}; DEF:{3}; THP:{4}; LDMG:{5:0.####})", + this.Count, + this.Creature.GetType().Name, + this.CurrentAttack, + this.CurrentDefense, + this.TotalHitPoints, + this.lastDamage); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/IBattleManager.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/IBattleManager.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/IBattleManager.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/IBattleManager.cs diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs similarity index 95% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs index 3ef6cf9..ba168a1 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs @@ -1,27 +1,27 @@ -using ArmyOfCreatures.Logic.Creatures; - -namespace ArmyOfCreatures.Logic.Battles -{ - public interface ICreaturesInBattle - { - Creature Creature { get; } - - int CurrentAttack { get; set; } - - int PermanentAttack { get; set; } - - int CurrentDefense { get; set; } - - int PermanentDefense { get; set; } - - int TotalHitPoints { get; set; } - - int Count { get; } - - void DealDamage(ICreaturesInBattle defender); - - void Skip(); - - void StartNewTurn(); - } -} +using ArmyOfCreatures.Logic.Creatures; + +namespace ArmyOfCreatures.Logic.Battles +{ + public interface ICreaturesInBattle + { + Creature Creature { get; } + + int CurrentAttack { get; set; } + + int PermanentAttack { get; set; } + + int CurrentDefense { get; set; } + + int PermanentDefense { get; set; } + + int TotalHitPoints { get; set; } + + int Count { get; } + + void DealDamage(ICreaturesInBattle defender); + + void Skip(); + + void StartNewTurn(); + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Angel.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Angel.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Angel.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Angel.cs index 3159aeb..a9bf6eb 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Angel.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Angel.cs @@ -1,14 +1,14 @@ -using ArmyOfCreatures.Logic.Specialties; - -namespace ArmyOfCreatures.Logic.Creatures -{ - public class Angel : Creature - { - public Angel() - : base(20, 20, 200, 50) - { - this.AddSpecialty(new Hate(typeof(Devil))); - this.AddSpecialty(new Hate(typeof(ArchDevil))); - } - } +using ArmyOfCreatures.Logic.Specialties; + +namespace ArmyOfCreatures.Logic.Creatures +{ + public class Angel : Creature + { + public Angel() + : base(20, 20, 200, 50) + { + this.AddSpecialty(new Hate(typeof(Devil))); + this.AddSpecialty(new Hate(typeof(ArchDevil))); + } + } } \ No newline at end of file diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs index 4d12b60..d575415 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs @@ -1,15 +1,15 @@ -using ArmyOfCreatures.Logic.Specialties; - -namespace ArmyOfCreatures.Logic.Creatures -{ - public class ArchDevil : Creature - { - public ArchDevil() - : base(21, 28, 200, 35) - { - this.AddSpecialty(new Hate(typeof(Angel))); - this.AddSpecialty(new Hate(typeof(Archangel))); - this.AddSpecialty(new ReduceEnemyDefenseByPercentage(100)); - } - } +using ArmyOfCreatures.Logic.Specialties; + +namespace ArmyOfCreatures.Logic.Creatures +{ + public class ArchDevil : Creature + { + public ArchDevil() + : base(21, 28, 200, 35) + { + this.AddSpecialty(new Hate(typeof(Angel))); + this.AddSpecialty(new Hate(typeof(Archangel))); + this.AddSpecialty(new ReduceEnemyDefenseByPercentage(100)); + } + } } \ No newline at end of file diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Archangel.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Archangel.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Archangel.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Archangel.cs index 76a733d..df38b41 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Archangel.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Archangel.cs @@ -1,15 +1,15 @@ -using ArmyOfCreatures.Logic.Specialties; - -namespace ArmyOfCreatures.Logic.Creatures -{ - public class Archangel : Creature - { - public Archangel() - : base(30, 30, 250, 50) - { - this.AddSpecialty(new Hate(typeof(Devil))); - this.AddSpecialty(new Hate(typeof(ArchDevil))); - this.AddSpecialty(new Resurrection()); - } - } -} +using ArmyOfCreatures.Logic.Specialties; + +namespace ArmyOfCreatures.Logic.Creatures +{ + public class Archangel : Creature + { + public Archangel() + : base(30, 30, 250, 50) + { + this.AddSpecialty(new Hate(typeof(Devil))); + this.AddSpecialty(new Hate(typeof(ArchDevil))); + this.AddSpecialty(new Resurrection()); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Behemoth.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Behemoth.cs similarity index 95% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Behemoth.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Behemoth.cs index 5391450..779fc3f 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Behemoth.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Behemoth.cs @@ -1,13 +1,13 @@ -using ArmyOfCreatures.Logic.Specialties; - -namespace ArmyOfCreatures.Logic.Creatures -{ - public class Behemoth : Creature - { - public Behemoth() - : base(17, 17, 160, 40) - { - this.AddSpecialty(new ReduceEnemyDefenseByPercentage(40)); - } - } -} +using ArmyOfCreatures.Logic.Specialties; + +namespace ArmyOfCreatures.Logic.Creatures +{ + public class Behemoth : Creature + { + public Behemoth() + : base(17, 17, 160, 40) + { + this.AddSpecialty(new ReduceEnemyDefenseByPercentage(40)); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Creature.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Creature.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Creature.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Creature.cs index 66e095b..e84f6de 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Creature.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Creature.cs @@ -1,68 +1,68 @@ -using System.Collections.Generic; -using System.Globalization; -using System.Text; - -using ArmyOfCreatures.Logic.Specialties; - -namespace ArmyOfCreatures.Logic.Creatures -{ - public abstract class Creature - { - private readonly ICollection specialtiesList; - - protected Creature(int attack, int defense, int healthPoints, decimal damage) - { - this.Attack = attack; - this.Defense = defense; - this.HealthPoints = healthPoints; - this.Damage = damage; - this.specialtiesList = new List(); - } - - public int Attack { get; private set; } - - public int Defense { get; private set; } - - public int HealthPoints { get; private set; } - - public decimal Damage { get; private set; } - - public IEnumerable Specialties - { - get - { - return this.specialtiesList; - } - } - - public override string ToString() - { - var stringBuilder = new StringBuilder(); - stringBuilder.AppendFormat( - CultureInfo.InvariantCulture, - "{0} (ATT:{1}; DEF:{2}; HP:{3}; DMG:{4})", - this.GetType().Name, - this.Attack, - this.Defense, - this.HealthPoints, - this.Damage); - - // Battle effects - stringBuilder.Append(" ["); - foreach (var speciallity in this.specialtiesList) - { - stringBuilder.AppendFormat("{0},", speciallity); - } - - var result = stringBuilder.ToString().TrimEnd(','); - result += "]"; - - return result; - } - - protected void AddSpecialty(Specialty specialtyToAdd) - { - this.specialtiesList.Add(specialtyToAdd); - } - } -} +using System.Collections.Generic; +using System.Globalization; +using System.Text; + +using ArmyOfCreatures.Logic.Specialties; + +namespace ArmyOfCreatures.Logic.Creatures +{ + public abstract class Creature + { + private readonly ICollection specialtiesList; + + protected Creature(int attack, int defense, int healthPoints, decimal damage) + { + this.Attack = attack; + this.Defense = defense; + this.HealthPoints = healthPoints; + this.Damage = damage; + this.specialtiesList = new List(); + } + + public int Attack { get; private set; } + + public int Defense { get; private set; } + + public int HealthPoints { get; private set; } + + public decimal Damage { get; private set; } + + public IEnumerable Specialties + { + get + { + return this.specialtiesList; + } + } + + public override string ToString() + { + var stringBuilder = new StringBuilder(); + stringBuilder.AppendFormat( + CultureInfo.InvariantCulture, + "{0} (ATT:{1}; DEF:{2}; HP:{3}; DMG:{4})", + this.GetType().Name, + this.Attack, + this.Defense, + this.HealthPoints, + this.Damage); + + // Battle effects + stringBuilder.Append(" ["); + foreach (var speciallity in this.specialtiesList) + { + stringBuilder.AppendFormat("{0},", speciallity); + } + + var result = stringBuilder.ToString().TrimEnd(','); + result += "]"; + + return result; + } + + protected void AddSpecialty(Specialty specialtyToAdd) + { + this.specialtiesList.Add(specialtyToAdd); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Devil.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Devil.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Devil.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Devil.cs index 5dd91f0..c073d35 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Devil.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Devil.cs @@ -1,15 +1,15 @@ -using ArmyOfCreatures.Logic.Specialties; - -namespace ArmyOfCreatures.Logic.Creatures -{ - public class Devil : Creature - { - public Devil() - : base(19, 26, 160, 35) - { - this.AddSpecialty(new Hate(typeof(Angel))); - this.AddSpecialty(new Hate(typeof(Archangel))); - this.AddSpecialty(new ReduceEnemyDefenseByPercentage(100)); - } - } +using ArmyOfCreatures.Logic.Specialties; + +namespace ArmyOfCreatures.Logic.Creatures +{ + public class Devil : Creature + { + public Devil() + : base(19, 26, 160, 35) + { + this.AddSpecialty(new Hate(typeof(Angel))); + this.AddSpecialty(new Hate(typeof(Archangel))); + this.AddSpecialty(new ReduceEnemyDefenseByPercentage(100)); + } + } } \ No newline at end of file diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/CreaturesFactory.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/CreaturesFactory.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/CreaturesFactory.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/CreaturesFactory.cs index 1137454..bcbc7e0 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/CreaturesFactory.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/CreaturesFactory.cs @@ -1,30 +1,30 @@ -using System; -using System.Globalization; - -using ArmyOfCreatures.Logic.Creatures; - -namespace ArmyOfCreatures.Logic -{ - public class CreaturesFactory : ICreaturesFactory - { - public virtual Creature CreateCreature(string name) - { - switch (name) - { - case "Angel": - return new Angel(); - case "Archangel": - return new Archangel(); - case "ArchDevil": - return new ArchDevil(); - case "Behemoth": - return new Behemoth(); - case "Devil": - return new Devil(); - default: - throw new ArgumentException( - string.Format(CultureInfo.InvariantCulture, "Invalid creature type \"{0}\"!", name)); - } - } - } -} +using System; +using System.Globalization; + +using ArmyOfCreatures.Logic.Creatures; + +namespace ArmyOfCreatures.Logic +{ + public class CreaturesFactory : ICreaturesFactory + { + public virtual Creature CreateCreature(string name) + { + switch (name) + { + case "Angel": + return new Angel(); + case "Archangel": + return new Archangel(); + case "ArchDevil": + return new ArchDevil(); + case "Behemoth": + return new Behemoth(); + case "Devil": + return new Devil(); + default: + throw new ArgumentException( + string.Format(CultureInfo.InvariantCulture, "Invalid creature type \"{0}\"!", name)); + } + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ICreaturesFactory.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ICreaturesFactory.cs similarity index 95% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ICreaturesFactory.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ICreaturesFactory.cs index 739bad5..70ec743 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ICreaturesFactory.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ICreaturesFactory.cs @@ -1,9 +1,9 @@ -using ArmyOfCreatures.Logic.Creatures; - -namespace ArmyOfCreatures.Logic -{ - public interface ICreaturesFactory - { - Creature CreateCreature(string name); - } -} +using ArmyOfCreatures.Logic.Creatures; + +namespace ArmyOfCreatures.Logic +{ + public interface ICreaturesFactory + { + Creature CreateCreature(string name); + } +} diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/ILogger.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ILogger.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/ILogger.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ILogger.cs diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/AddDefenseWhenSkip.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/AddDefenseWhenSkip.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/AddDefenseWhenSkip.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/AddDefenseWhenSkip.cs index bafa6a2..c159fbd 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/AddDefenseWhenSkip.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/AddDefenseWhenSkip.cs @@ -1,37 +1,37 @@ -using System; -using System.Globalization; - -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Logic.Specialties -{ - public class AddDefenseWhenSkip : Specialty - { - private readonly int defenseToAdd; - - public AddDefenseWhenSkip(int defenseToAdd) - { - if (defenseToAdd < 1 || defenseToAdd > 20) - { - throw new ArgumentOutOfRangeException("defenseToAdd", "defenseToAdd should be between 1 and 20, inclusive"); - } - - this.defenseToAdd = defenseToAdd; - } - - public override void ApplyOnSkip(ICreaturesInBattle skipCreature) - { - if (skipCreature == null) - { - throw new ArgumentNullException("skipCreature"); - } - - skipCreature.PermanentDefense += this.defenseToAdd; - } - - public override string ToString() - { - return string.Format(CultureInfo.InvariantCulture, "{0}({1})", base.ToString(), this.defenseToAdd); - } - } -} +using System; +using System.Globalization; + +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Logic.Specialties +{ + public class AddDefenseWhenSkip : Specialty + { + private readonly int defenseToAdd; + + public AddDefenseWhenSkip(int defenseToAdd) + { + if (defenseToAdd < 1 || defenseToAdd > 20) + { + throw new ArgumentOutOfRangeException("defenseToAdd", "defenseToAdd should be between 1 and 20, inclusive"); + } + + this.defenseToAdd = defenseToAdd; + } + + public override void ApplyOnSkip(ICreaturesInBattle skipCreature) + { + if (skipCreature == null) + { + throw new ArgumentNullException("skipCreature"); + } + + skipCreature.PermanentDefense += this.defenseToAdd; + } + + public override string ToString() + { + return string.Format(CultureInfo.InvariantCulture, "{0}({1})", base.ToString(), this.defenseToAdd); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/DoubleDefenseWhenDefending.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/DoubleDefenseWhenDefending.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/DoubleDefenseWhenDefending.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/DoubleDefenseWhenDefending.cs index d0e12cd..20a62bb 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/DoubleDefenseWhenDefending.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/DoubleDefenseWhenDefending.cs @@ -1,49 +1,49 @@ -using System; -using System.Globalization; - -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Logic.Specialties -{ - public class DoubleDefenseWhenDefending : Specialty - { - private int rounds; - - public DoubleDefenseWhenDefending(int rounds) - { - if (rounds <= 0) - { - throw new ArgumentOutOfRangeException("rounds", "The number of rounds should be greater than 0"); - } - - this.rounds = rounds; - } - - public override void ApplyWhenDefending(ICreaturesInBattle defenderWithSpecialty, ICreaturesInBattle attacker) - { - if (defenderWithSpecialty == null) - { - throw new ArgumentNullException("defenderWithSpecialty"); - } - - if (attacker == null) - { - throw new ArgumentNullException("attacker"); - } - - if (this.rounds <= 0) - { - // Effect expires after fixed number of rounds - return; - } - - defenderWithSpecialty.CurrentDefense *= 2; - this.rounds--; - } - - public override string ToString() - { - return string.Format(CultureInfo.InvariantCulture, "{0}({1})", base.ToString(), this.rounds); - } - } -} +using System; +using System.Globalization; + +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Logic.Specialties +{ + public class DoubleDefenseWhenDefending : Specialty + { + private int rounds; + + public DoubleDefenseWhenDefending(int rounds) + { + if (rounds <= 0) + { + throw new ArgumentOutOfRangeException("rounds", "The number of rounds should be greater than 0"); + } + + this.rounds = rounds; + } + + public override void ApplyWhenDefending(ICreaturesInBattle defenderWithSpecialty, ICreaturesInBattle attacker) + { + if (defenderWithSpecialty == null) + { + throw new ArgumentNullException("defenderWithSpecialty"); + } + + if (attacker == null) + { + throw new ArgumentNullException("attacker"); + } + + if (this.rounds <= 0) + { + // Effect expires after fixed number of rounds + return; + } + + defenderWithSpecialty.CurrentDefense *= 2; + this.rounds--; + } + + public override string ToString() + { + return string.Format(CultureInfo.InvariantCulture, "{0}({1})", base.ToString(), this.rounds); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Hate.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Hate.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Hate.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Hate.cs index bf26ac5..6859a34 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Hate.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Hate.cs @@ -1,54 +1,54 @@ -using System; -using System.Globalization; - -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Logic.Specialties -{ - public class Hate : Specialty - { - private readonly Type creatureTypeToHate; - - public Hate(Type creatureTypeToHate) - { - if (creatureTypeToHate == null) - { - throw new ArgumentNullException("creatureTypeToHate"); - } - - this.creatureTypeToHate = creatureTypeToHate; - } - - public override decimal ChangeDamageWhenAttacking( - ICreaturesInBattle attackerWithSpecialty, - ICreaturesInBattle defender, - decimal currentDamage) - { - if (attackerWithSpecialty == null) - { - throw new ArgumentNullException("attackerWithSpecialty"); - } - - if (defender == null) - { - throw new ArgumentNullException("defender"); - } - - if (defender.Creature.GetType() == this.creatureTypeToHate) - { - return currentDamage * 1.5M; - } - - return currentDamage; - } - - public override string ToString() - { - return string.Format( - CultureInfo.InvariantCulture, - "{0}({1})", - base.ToString(), - this.creatureTypeToHate.Name); - } - } -} +using System; +using System.Globalization; + +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Logic.Specialties +{ + public class Hate : Specialty + { + private readonly Type creatureTypeToHate; + + public Hate(Type creatureTypeToHate) + { + if (creatureTypeToHate == null) + { + throw new ArgumentNullException("creatureTypeToHate"); + } + + this.creatureTypeToHate = creatureTypeToHate; + } + + public override decimal ChangeDamageWhenAttacking( + ICreaturesInBattle attackerWithSpecialty, + ICreaturesInBattle defender, + decimal currentDamage) + { + if (attackerWithSpecialty == null) + { + throw new ArgumentNullException("attackerWithSpecialty"); + } + + if (defender == null) + { + throw new ArgumentNullException("defender"); + } + + if (defender.Creature.GetType() == this.creatureTypeToHate) + { + return currentDamage * 1.5M; + } + + return currentDamage; + } + + public override string ToString() + { + return string.Format( + CultureInfo.InvariantCulture, + "{0}({1})", + base.ToString(), + this.creatureTypeToHate.Name); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/ReduceEnemyDefenseByPercentage.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/ReduceEnemyDefenseByPercentage.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/ReduceEnemyDefenseByPercentage.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/ReduceEnemyDefenseByPercentage.cs index c327b5e..51c92ab 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/ReduceEnemyDefenseByPercentage.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/ReduceEnemyDefenseByPercentage.cs @@ -1,43 +1,43 @@ -using System; -using System.Globalization; - -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Logic.Specialties -{ - public class ReduceEnemyDefenseByPercentage : Specialty - { - public ReduceEnemyDefenseByPercentage(decimal percentage) - { - if (percentage < 0 || percentage > 100) - { - throw new ArgumentOutOfRangeException("percentage", "The percentage argument should be between 0 and 100, inclusive"); - } - - this.Percentage = percentage; - } - - private decimal Percentage { get; set; } - - public override void ApplyWhenAttacking(ICreaturesInBattle attackerWithSpecialty, ICreaturesInBattle defender) - { - if (attackerWithSpecialty == null) - { - throw new ArgumentNullException("attackerWithSpecialty"); - } - - if (defender == null) - { - throw new ArgumentNullException("defender"); - } - - var reduceDefenseBy = (int)(defender.CurrentDefense * (this.Percentage / 100.0M)); - defender.CurrentDefense = defender.CurrentDefense - reduceDefenseBy; - } - - public override string ToString() - { - return string.Format(CultureInfo.InvariantCulture, "{0}({1})", base.ToString(), this.Percentage); - } - } -} +using System; +using System.Globalization; + +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Logic.Specialties +{ + public class ReduceEnemyDefenseByPercentage : Specialty + { + public ReduceEnemyDefenseByPercentage(decimal percentage) + { + if (percentage < 0 || percentage > 100) + { + throw new ArgumentOutOfRangeException("percentage", "The percentage argument should be between 0 and 100, inclusive"); + } + + this.Percentage = percentage; + } + + private decimal Percentage { get; set; } + + public override void ApplyWhenAttacking(ICreaturesInBattle attackerWithSpecialty, ICreaturesInBattle defender) + { + if (attackerWithSpecialty == null) + { + throw new ArgumentNullException("attackerWithSpecialty"); + } + + if (defender == null) + { + throw new ArgumentNullException("defender"); + } + + var reduceDefenseBy = (int)(defender.CurrentDefense * (this.Percentage / 100.0M)); + defender.CurrentDefense = defender.CurrentDefense - reduceDefenseBy; + } + + public override string ToString() + { + return string.Format(CultureInfo.InvariantCulture, "{0}({1})", base.ToString(), this.Percentage); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Resurrection.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Resurrection.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Resurrection.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Resurrection.cs index 5a0662d..1c4c2c8 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Resurrection.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Resurrection.cs @@ -1,23 +1,23 @@ -using System; - -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Logic.Specialties -{ - public class Resurrection : Specialty - { - public override void ApplyAfterDefending(ICreaturesInBattle defenderWithSpecialty) - { - if (defenderWithSpecialty == null) - { - throw new ArgumentNullException("defenderWithSpecialty"); - } - - if (defenderWithSpecialty.TotalHitPoints > 0) - { - defenderWithSpecialty.TotalHitPoints = defenderWithSpecialty.Count - * defenderWithSpecialty.Creature.HealthPoints; - } - } - } -} +using System; + +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Logic.Specialties +{ + public class Resurrection : Specialty + { + public override void ApplyAfterDefending(ICreaturesInBattle defenderWithSpecialty) + { + if (defenderWithSpecialty == null) + { + throw new ArgumentNullException("defenderWithSpecialty"); + } + + if (defenderWithSpecialty.TotalHitPoints > 0) + { + defenderWithSpecialty.TotalHitPoints = defenderWithSpecialty.Count + * defenderWithSpecialty.Creature.HealthPoints; + } + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Specialty.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Specialty.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Specialty.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Specialty.cs index d4e14b1..189aead 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Specialty.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Specialty.cs @@ -1,33 +1,33 @@ -using ArmyOfCreatures.Logic.Battles; - -namespace ArmyOfCreatures.Logic.Specialties -{ - public abstract class Specialty - { - public virtual void ApplyWhenAttacking(ICreaturesInBattle attackerWithSpecialty, ICreaturesInBattle defender) - { - } - - public virtual void ApplyWhenDefending(ICreaturesInBattle defenderWithSpecialty, ICreaturesInBattle attacker) - { - } - - public virtual void ApplyAfterDefending(ICreaturesInBattle defenderWithSpecialty) - { - } - - public virtual decimal ChangeDamageWhenAttacking(ICreaturesInBattle attackerWithSpecialty, ICreaturesInBattle defender, decimal currentDamage) - { - return currentDamage; - } - - public virtual void ApplyOnSkip(ICreaturesInBattle skipCreature) - { - } - - public override string ToString() - { - return this.GetType().Name; - } - } -} +using ArmyOfCreatures.Logic.Battles; + +namespace ArmyOfCreatures.Logic.Specialties +{ + public abstract class Specialty + { + public virtual void ApplyWhenAttacking(ICreaturesInBattle attackerWithSpecialty, ICreaturesInBattle defender) + { + } + + public virtual void ApplyWhenDefending(ICreaturesInBattle defenderWithSpecialty, ICreaturesInBattle attacker) + { + } + + public virtual void ApplyAfterDefending(ICreaturesInBattle defenderWithSpecialty) + { + } + + public virtual decimal ChangeDamageWhenAttacking(ICreaturesInBattle attackerWithSpecialty, ICreaturesInBattle defender, decimal currentDamage) + { + return currentDamage; + } + + public virtual void ApplyOnSkip(ICreaturesInBattle skipCreature) + { + } + + public override string ToString() + { + return this.GetType().Name; + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Properties/AssemblyInfo.cs b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Properties/AssemblyInfo.cs similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Properties/AssemblyInfo.cs rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Properties/AssemblyInfo.cs index 7e39758..2974e8f 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Properties/AssemblyInfo.cs +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Properties/AssemblyInfo.cs @@ -1,39 +1,39 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ArmyOfCreatures.Console")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ArmyOfCreatures.Console")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("8d68b1aa-c564-4a1a-812c-5ba491cfb1de")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: CLSCompliant(true)] -[assembly: InternalsVisibleTo("ArmyOfCreatures.Tests")] +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ArmyOfCreatures.Console")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ArmyOfCreatures.Console")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8d68b1aa-c564-4a1a-812c-5ba491cfb1de")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: CLSCompliant(true)] +[assembly: InternalsVisibleTo("ArmyOfCreatures.Tests")] diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/Settings.StyleCop b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/Settings.StyleCop similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/Settings.StyleCop rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/Settings.StyleCop diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.in.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.in.txt similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.in.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.in.txt index 6c52f19..d564781 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.in.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.in.txt @@ -1,22 +1,22 @@ -add 10 AncientBehemoth(1) -add 100 WolfRaider(1) -add 100 Goblin(1) -add 10 CyclopsKing(2) -add 50 Griffin(2) -add 10 Archangel(2) -attack Archangel(2) Goblin(1) -attack AncientBehemoth(1) Archangel(2) -attack Griffin(2) WolfRaider(1) -attack WolfRaider(1) Griffin(2) -skip CyclopsKing(2) -attack Archangel(2) WolfRaider(1) -attack AncientBehemoth(1) Archangel(2) -attack Griffin(2) AncientBehemoth(1) -attack CyclopsKing(2) AncientBehemoth(1) -attack Archangel(2) AncientBehemoth(1) -attack AncientBehemoth(1) CyclopsKing(2) -attack Griffin(2) AncientBehemoth(1) -attack CyclopsKing(2) AncientBehemoth(1) -attack Archangel(2) AncientBehemoth(1) -attack AncientBehemoth(1) CyclopsKing(2) -exit +add 10 AncientBehemoth(1) +add 100 WolfRaider(1) +add 100 Goblin(1) +add 10 CyclopsKing(2) +add 50 Griffin(2) +add 10 Archangel(2) +attack Archangel(2) Goblin(1) +attack AncientBehemoth(1) Archangel(2) +attack Griffin(2) WolfRaider(1) +attack WolfRaider(1) Griffin(2) +skip CyclopsKing(2) +attack Archangel(2) WolfRaider(1) +attack AncientBehemoth(1) Archangel(2) +attack Griffin(2) AncientBehemoth(1) +attack CyclopsKing(2) AncientBehemoth(1) +attack Archangel(2) AncientBehemoth(1) +attack AncientBehemoth(1) CyclopsKing(2) +attack Griffin(2) AncientBehemoth(1) +attack CyclopsKing(2) AncientBehemoth(1) +attack Archangel(2) AncientBehemoth(1) +attack AncientBehemoth(1) CyclopsKing(2) +exit diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.out.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.out.txt similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.out.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.out.txt index 17f63c2..da5b3eb 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.out.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.out.txt @@ -1,64 +1,64 @@ ---- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] ---- Creature added to army 1 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] ---- Creature added to army 1 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] ---- Creature added to army 2 - CyclopsKing (ATT:17; DEF:13; HP:70; DMG:18) [AddAttackWhenSkip(3),DoubleAttackWhenAttacking(4),DoubleDamage(1)] ---- Creature added to army 2 - Griffin (ATT:8; DEF:8; HP:25; DMG:4.5) [DoubleDefenseWhenDefending(5),AddDefenseWhenSkip(3),Hate(WolfRaider)] ---- Creature added to army 2 - Archangel (ATT:30; DEF:30; HP:250; DMG:50) [Hate(Devil),Hate(ArchDevil),Resurrection] ---- Attacker before - 10 Archangel (ATT:30; DEF:30; THP:2500; LDMG:0) ---- Defender before - 100 Goblin (ATT:4; DEF:2; THP:500; LDMG:0) ---- Attacker after - 10 Archangel (ATT:30; DEF:30; THP:2500; LDMG:1200) ---- Defender after - 0 Goblin (ATT:4; DEF:2; THP:0; LDMG:0) ---- Attacker before - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:0) ---- Defender before - 10 Archangel (ATT:30; DEF:30; THP:2500; LDMG:0) ---- Attacker after - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:660) ---- Defender after - 8 Archangel (ATT:30; DEF:6; THP:2000; LDMG:0) ---- Attacker before - 50 Griffin (ATT:8; DEF:8; THP:1250; LDMG:0) ---- Defender before - 100 WolfRaider (ATT:8; DEF:5; THP:1000; LDMG:0) ---- Attacker after - 50 Griffin (ATT:8; DEF:8; THP:1250; LDMG:388.125) ---- Defender after - 62 WolfRaider (ATT:8; DEF:5; THP:612; LDMG:0) ---- Attacker before - 62 WolfRaider (ATT:8; DEF:5; THP:612; LDMG:0) ---- Defender before - 50 Griffin (ATT:8; DEF:8; THP:1250; LDMG:0) ---- Attacker after - 62 WolfRaider (ATT:8; DEF:5; THP:612; LDMG:347.2) ---- Defender after - 37 Griffin (ATT:8; DEF:16; THP:903; LDMG:0) ---- Before skip - 10 CyclopsKing (ATT:17; DEF:13; THP:700; LDMG:0) ---- After skip - 10 CyclopsKing (ATT:20; DEF:16; THP:700; LDMG:0) ---- Attacker before - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:0) ---- Defender before - 62 WolfRaider (ATT:8; DEF:5; THP:612; LDMG:0) ---- Attacker after - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:900) ---- Defender after - 0 WolfRaider (ATT:8; DEF:5; THP:0; LDMG:0) ---- Attacker before - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:0) ---- Defender before - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:0) ---- Attacker after - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:660) ---- Defender after - 6 Archangel (ATT:30; DEF:6; THP:1500; LDMG:0) ---- Attacker before - 37 Griffin (ATT:8; DEF:8; THP:903; LDMG:0) ---- Defender before - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:0) ---- Attacker after - 37 Griffin (ATT:8; DEF:8; THP:903; LDMG:49.95) ---- Defender after - 10 AncientBehemoth (ATT:19; DEF:38; THP:2951; LDMG:0) ---- Attacker before - 10 CyclopsKing (ATT:20; DEF:16; THP:700; LDMG:0) ---- Defender before - 10 AncientBehemoth (ATT:19; DEF:19; THP:2951; LDMG:0) ---- Attacker after - 10 CyclopsKing (ATT:40; DEF:16; THP:700; LDMG:396) ---- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2555; LDMG:0) ---- Attacker before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) ---- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2555; LDMG:0) ---- Attacker after - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:240) ---- Defender after - 8 AncientBehemoth (ATT:19; DEF:38; THP:2315; LDMG:0) ---- Attacker before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2315; LDMG:0) ---- Defender before - 10 CyclopsKing (ATT:20; DEF:16; THP:700; LDMG:0) ---- Attacker after - 8 AncientBehemoth (ATT:19; DEF:19; THP:2315; LDMG:560) ---- Defender after - 2 CyclopsKing (ATT:20; DEF:4; THP:140; LDMG:0) ---- Attacker before - 37 Griffin (ATT:8; DEF:8; THP:903; LDMG:0) ---- Defender before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2315; LDMG:0) ---- Attacker after - 37 Griffin (ATT:8; DEF:8; THP:903; LDMG:49.95) ---- Defender after - 8 AncientBehemoth (ATT:19; DEF:38; THP:2266; LDMG:0) ---- Attacker before - 2 CyclopsKing (ATT:20; DEF:16; THP:140; LDMG:0) ---- Defender before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2266; LDMG:0) ---- Attacker after - 2 CyclopsKing (ATT:40; DEF:16; THP:140; LDMG:39.6) ---- Defender after - 8 AncientBehemoth (ATT:19; DEF:38; THP:2227; LDMG:0) ---- Attacker before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) ---- Defender before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2227; LDMG:0) ---- Attacker after - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:465) ---- Defender after - 6 AncientBehemoth (ATT:19; DEF:19; THP:1762; LDMG:0) ---- Attacker before - 6 AncientBehemoth (ATT:19; DEF:19; THP:1762; LDMG:0) ---- Defender before - 2 CyclopsKing (ATT:20; DEF:16; THP:140; LDMG:0) ---- Attacker after - 6 AncientBehemoth (ATT:19; DEF:19; THP:1762; LDMG:420) ---- Defender after - 0 CyclopsKing (ATT:20; DEF:4; THP:0; LDMG:0) +--- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] +--- Creature added to army 1 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] +--- Creature added to army 1 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] +--- Creature added to army 2 - CyclopsKing (ATT:17; DEF:13; HP:70; DMG:18) [AddAttackWhenSkip(3),DoubleAttackWhenAttacking(4),DoubleDamage(1)] +--- Creature added to army 2 - Griffin (ATT:8; DEF:8; HP:25; DMG:4.5) [DoubleDefenseWhenDefending(5),AddDefenseWhenSkip(3),Hate(WolfRaider)] +--- Creature added to army 2 - Archangel (ATT:30; DEF:30; HP:250; DMG:50) [Hate(Devil),Hate(ArchDevil),Resurrection] +--- Attacker before - 10 Archangel (ATT:30; DEF:30; THP:2500; LDMG:0) +--- Defender before - 100 Goblin (ATT:4; DEF:2; THP:500; LDMG:0) +--- Attacker after - 10 Archangel (ATT:30; DEF:30; THP:2500; LDMG:1200) +--- Defender after - 0 Goblin (ATT:4; DEF:2; THP:0; LDMG:0) +--- Attacker before - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:0) +--- Defender before - 10 Archangel (ATT:30; DEF:30; THP:2500; LDMG:0) +--- Attacker after - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:660) +--- Defender after - 8 Archangel (ATT:30; DEF:6; THP:2000; LDMG:0) +--- Attacker before - 50 Griffin (ATT:8; DEF:8; THP:1250; LDMG:0) +--- Defender before - 100 WolfRaider (ATT:8; DEF:5; THP:1000; LDMG:0) +--- Attacker after - 50 Griffin (ATT:8; DEF:8; THP:1250; LDMG:388.125) +--- Defender after - 62 WolfRaider (ATT:8; DEF:5; THP:612; LDMG:0) +--- Attacker before - 62 WolfRaider (ATT:8; DEF:5; THP:612; LDMG:0) +--- Defender before - 50 Griffin (ATT:8; DEF:8; THP:1250; LDMG:0) +--- Attacker after - 62 WolfRaider (ATT:8; DEF:5; THP:612; LDMG:347.2) +--- Defender after - 37 Griffin (ATT:8; DEF:16; THP:903; LDMG:0) +--- Before skip - 10 CyclopsKing (ATT:17; DEF:13; THP:700; LDMG:0) +--- After skip - 10 CyclopsKing (ATT:20; DEF:16; THP:700; LDMG:0) +--- Attacker before - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:0) +--- Defender before - 62 WolfRaider (ATT:8; DEF:5; THP:612; LDMG:0) +--- Attacker after - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:900) +--- Defender after - 0 WolfRaider (ATT:8; DEF:5; THP:0; LDMG:0) +--- Attacker before - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:0) +--- Defender before - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:0) +--- Attacker after - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:660) +--- Defender after - 6 Archangel (ATT:30; DEF:6; THP:1500; LDMG:0) +--- Attacker before - 37 Griffin (ATT:8; DEF:8; THP:903; LDMG:0) +--- Defender before - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:0) +--- Attacker after - 37 Griffin (ATT:8; DEF:8; THP:903; LDMG:49.95) +--- Defender after - 10 AncientBehemoth (ATT:19; DEF:38; THP:2951; LDMG:0) +--- Attacker before - 10 CyclopsKing (ATT:20; DEF:16; THP:700; LDMG:0) +--- Defender before - 10 AncientBehemoth (ATT:19; DEF:19; THP:2951; LDMG:0) +--- Attacker after - 10 CyclopsKing (ATT:40; DEF:16; THP:700; LDMG:396) +--- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2555; LDMG:0) +--- Attacker before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) +--- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2555; LDMG:0) +--- Attacker after - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:240) +--- Defender after - 8 AncientBehemoth (ATT:19; DEF:38; THP:2315; LDMG:0) +--- Attacker before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2315; LDMG:0) +--- Defender before - 10 CyclopsKing (ATT:20; DEF:16; THP:700; LDMG:0) +--- Attacker after - 8 AncientBehemoth (ATT:19; DEF:19; THP:2315; LDMG:560) +--- Defender after - 2 CyclopsKing (ATT:20; DEF:4; THP:140; LDMG:0) +--- Attacker before - 37 Griffin (ATT:8; DEF:8; THP:903; LDMG:0) +--- Defender before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2315; LDMG:0) +--- Attacker after - 37 Griffin (ATT:8; DEF:8; THP:903; LDMG:49.95) +--- Defender after - 8 AncientBehemoth (ATT:19; DEF:38; THP:2266; LDMG:0) +--- Attacker before - 2 CyclopsKing (ATT:20; DEF:16; THP:140; LDMG:0) +--- Defender before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2266; LDMG:0) +--- Attacker after - 2 CyclopsKing (ATT:40; DEF:16; THP:140; LDMG:39.6) +--- Defender after - 8 AncientBehemoth (ATT:19; DEF:38; THP:2227; LDMG:0) +--- Attacker before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) +--- Defender before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2227; LDMG:0) +--- Attacker after - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:465) +--- Defender after - 6 AncientBehemoth (ATT:19; DEF:19; THP:1762; LDMG:0) +--- Attacker before - 6 AncientBehemoth (ATT:19; DEF:19; THP:1762; LDMG:0) +--- Defender before - 2 CyclopsKing (ATT:20; DEF:16; THP:140; LDMG:0) +--- Attacker after - 6 AncientBehemoth (ATT:19; DEF:19; THP:1762; LDMG:420) +--- Defender after - 0 CyclopsKing (ATT:20; DEF:4; THP:0; LDMG:0) diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.in.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.in.txt similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.in.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.in.txt index d26d90a..05ebb7e 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.in.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.in.txt @@ -1,18 +1,18 @@ -add 10 Angel(1) -add 10 Devil(1) -add 10 Archangel(2) -add 10 ArchDevil(3) -attack Archangel(2) Devil(1) -attack ArchDevil(3) Angel(1) -attack Angel(1) ArchDevil(3) -attack Devil(1) Archangel(2) -attack Archangel(2) Devil(1) -attack ArchDevil(3) Angel(1) -attack Archangel(2) ArchDevil(3) -attack ArchDevil(3) Archangel(2) -attack Archangel(2) ArchDevil(3) -attack ArchDevil(3) Archangel(2) -attack Archangel(2) ArchDevil(3) -attack ArchDevil(3) Archangel(2) -attack Archangel(2) ArchDevil(3) -exit +add 10 Angel(1) +add 10 Devil(1) +add 10 Archangel(2) +add 10 ArchDevil(3) +attack Archangel(2) Devil(1) +attack ArchDevil(3) Angel(1) +attack Angel(1) ArchDevil(3) +attack Devil(1) Archangel(2) +attack Archangel(2) Devil(1) +attack ArchDevil(3) Angel(1) +attack Archangel(2) ArchDevil(3) +attack ArchDevil(3) Archangel(2) +attack Archangel(2) ArchDevil(3) +attack ArchDevil(3) Archangel(2) +attack Archangel(2) ArchDevil(3) +attack ArchDevil(3) Archangel(2) +attack Archangel(2) ArchDevil(3) +exit diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.out.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.out.txt similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.out.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.out.txt index 151b269..cf8e872 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.out.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.out.txt @@ -1,56 +1,56 @@ ---- Creature added to army 1 - Angel (ATT:20; DEF:20; HP:200; DMG:50) [Hate(Devil),Hate(ArchDevil)] ---- Creature added to army 1 - Devil (ATT:19; DEF:26; HP:160; DMG:35) [Hate(Angel),Hate(Archangel),ReduceEnemyDefenseByPercentage(100)] ---- Creature added to army 2 - Archangel (ATT:30; DEF:30; HP:250; DMG:50) [Hate(Devil),Hate(ArchDevil),Resurrection] ---- Creature added to army 3 - ArchDevil (ATT:21; DEF:28; HP:200; DMG:35) [Hate(Angel),Hate(Archangel),ReduceEnemyDefenseByPercentage(100)] ---- Attacker before - 10 Archangel (ATT:30; DEF:30; THP:2500; LDMG:0) ---- Defender before - 10 Devil (ATT:19; DEF:26; THP:1600; LDMG:0) ---- Attacker after - 10 Archangel (ATT:30; DEF:30; THP:2500; LDMG:900) ---- Defender after - 5 Devil (ATT:19; DEF:26; THP:700; LDMG:0) ---- Attacker before - 10 ArchDevil (ATT:21; DEF:28; THP:2000; LDMG:0) ---- Defender before - 10 Angel (ATT:20; DEF:20; THP:2000; LDMG:0) ---- Attacker after - 10 ArchDevil (ATT:21; DEF:28; THP:2000; LDMG:1076.25) ---- Defender after - 5 Angel (ATT:20; DEF:0; THP:924; LDMG:0) ---- Attacker before - 5 Angel (ATT:20; DEF:20; THP:924; LDMG:0) ---- Defender before - 10 ArchDevil (ATT:21; DEF:28; THP:2000; LDMG:0) ---- Attacker after - 5 Angel (ATT:20; DEF:20; THP:924; LDMG:300) ---- Defender after - 9 ArchDevil (ATT:21; DEF:28; THP:1700; LDMG:0) ---- Attacker before - 5 Devil (ATT:19; DEF:26; THP:700; LDMG:0) ---- Defender before - 10 Archangel (ATT:30; DEF:30; THP:2500; LDMG:0) ---- Attacker after - 5 Devil (ATT:19; DEF:26; THP:700; LDMG:511.875) ---- Defender after - 8 Archangel (ATT:30; DEF:0; THP:2000; LDMG:0) ---- Attacker before - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:0) ---- Defender before - 5 Devil (ATT:19; DEF:26; THP:700; LDMG:0) ---- Attacker after - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:720) ---- Defender after - 0 Devil (ATT:19; DEF:26; THP:0; LDMG:0) ---- Attacker before - 9 ArchDevil (ATT:21; DEF:28; THP:1700; LDMG:0) ---- Defender before - 5 Angel (ATT:20; DEF:20; THP:924; LDMG:0) ---- Attacker after - 9 ArchDevil (ATT:21; DEF:28; THP:1700; LDMG:968.625) ---- Defender after - 0 Angel (ATT:20; DEF:0; THP:0; LDMG:0) ---- Attacker before - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:0) ---- Defender before - 9 ArchDevil (ATT:21; DEF:28; THP:1700; LDMG:0) ---- Attacker after - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:660) ---- Defender after - 6 ArchDevil (ATT:21; DEF:28; THP:1040; LDMG:0) ---- Attacker before - 6 ArchDevil (ATT:21; DEF:28; THP:1040; LDMG:0) ---- Defender before - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:0) ---- Attacker after - 6 ArchDevil (ATT:21; DEF:28; THP:1040; LDMG:645.75) ---- Defender after - 6 Archangel (ATT:30; DEF:0; THP:1500; LDMG:0) ---- Attacker before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) ---- Defender before - 6 ArchDevil (ATT:21; DEF:28; THP:1040; LDMG:0) ---- Attacker after - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:495) ---- Defender after - 3 ArchDevil (ATT:21; DEF:28; THP:545; LDMG:0) ---- Attacker before - 3 ArchDevil (ATT:21; DEF:28; THP:545; LDMG:0) ---- Defender before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) ---- Attacker after - 3 ArchDevil (ATT:21; DEF:28; THP:545; LDMG:322.875) ---- Defender after - 5 Archangel (ATT:30; DEF:0; THP:1250; LDMG:0) ---- Attacker before - 5 Archangel (ATT:30; DEF:30; THP:1250; LDMG:0) ---- Defender before - 3 ArchDevil (ATT:21; DEF:28; THP:545; LDMG:0) ---- Attacker after - 5 Archangel (ATT:30; DEF:30; THP:1250; LDMG:412.5) ---- Defender after - 1 ArchDevil (ATT:21; DEF:28; THP:133; LDMG:0) ---- Attacker before - 1 ArchDevil (ATT:21; DEF:28; THP:133; LDMG:0) ---- Defender before - 5 Archangel (ATT:30; DEF:30; THP:1250; LDMG:0) ---- Attacker after - 1 ArchDevil (ATT:21; DEF:28; THP:133; LDMG:107.625) ---- Defender after - 5 Archangel (ATT:30; DEF:0; THP:1250; LDMG:0) ---- Attacker before - 5 Archangel (ATT:30; DEF:30; THP:1250; LDMG:0) ---- Defender before - 1 ArchDevil (ATT:21; DEF:28; THP:133; LDMG:0) ---- Attacker after - 5 Archangel (ATT:30; DEF:30; THP:1250; LDMG:412.5) ---- Defender after - 0 ArchDevil (ATT:21; DEF:28; THP:0; LDMG:0) +--- Creature added to army 1 - Angel (ATT:20; DEF:20; HP:200; DMG:50) [Hate(Devil),Hate(ArchDevil)] +--- Creature added to army 1 - Devil (ATT:19; DEF:26; HP:160; DMG:35) [Hate(Angel),Hate(Archangel),ReduceEnemyDefenseByPercentage(100)] +--- Creature added to army 2 - Archangel (ATT:30; DEF:30; HP:250; DMG:50) [Hate(Devil),Hate(ArchDevil),Resurrection] +--- Creature added to army 3 - ArchDevil (ATT:21; DEF:28; HP:200; DMG:35) [Hate(Angel),Hate(Archangel),ReduceEnemyDefenseByPercentage(100)] +--- Attacker before - 10 Archangel (ATT:30; DEF:30; THP:2500; LDMG:0) +--- Defender before - 10 Devil (ATT:19; DEF:26; THP:1600; LDMG:0) +--- Attacker after - 10 Archangel (ATT:30; DEF:30; THP:2500; LDMG:900) +--- Defender after - 5 Devil (ATT:19; DEF:26; THP:700; LDMG:0) +--- Attacker before - 10 ArchDevil (ATT:21; DEF:28; THP:2000; LDMG:0) +--- Defender before - 10 Angel (ATT:20; DEF:20; THP:2000; LDMG:0) +--- Attacker after - 10 ArchDevil (ATT:21; DEF:28; THP:2000; LDMG:1076.25) +--- Defender after - 5 Angel (ATT:20; DEF:0; THP:924; LDMG:0) +--- Attacker before - 5 Angel (ATT:20; DEF:20; THP:924; LDMG:0) +--- Defender before - 10 ArchDevil (ATT:21; DEF:28; THP:2000; LDMG:0) +--- Attacker after - 5 Angel (ATT:20; DEF:20; THP:924; LDMG:300) +--- Defender after - 9 ArchDevil (ATT:21; DEF:28; THP:1700; LDMG:0) +--- Attacker before - 5 Devil (ATT:19; DEF:26; THP:700; LDMG:0) +--- Defender before - 10 Archangel (ATT:30; DEF:30; THP:2500; LDMG:0) +--- Attacker after - 5 Devil (ATT:19; DEF:26; THP:700; LDMG:511.875) +--- Defender after - 8 Archangel (ATT:30; DEF:0; THP:2000; LDMG:0) +--- Attacker before - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:0) +--- Defender before - 5 Devil (ATT:19; DEF:26; THP:700; LDMG:0) +--- Attacker after - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:720) +--- Defender after - 0 Devil (ATT:19; DEF:26; THP:0; LDMG:0) +--- Attacker before - 9 ArchDevil (ATT:21; DEF:28; THP:1700; LDMG:0) +--- Defender before - 5 Angel (ATT:20; DEF:20; THP:924; LDMG:0) +--- Attacker after - 9 ArchDevil (ATT:21; DEF:28; THP:1700; LDMG:968.625) +--- Defender after - 0 Angel (ATT:20; DEF:0; THP:0; LDMG:0) +--- Attacker before - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:0) +--- Defender before - 9 ArchDevil (ATT:21; DEF:28; THP:1700; LDMG:0) +--- Attacker after - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:660) +--- Defender after - 6 ArchDevil (ATT:21; DEF:28; THP:1040; LDMG:0) +--- Attacker before - 6 ArchDevil (ATT:21; DEF:28; THP:1040; LDMG:0) +--- Defender before - 8 Archangel (ATT:30; DEF:30; THP:2000; LDMG:0) +--- Attacker after - 6 ArchDevil (ATT:21; DEF:28; THP:1040; LDMG:645.75) +--- Defender after - 6 Archangel (ATT:30; DEF:0; THP:1500; LDMG:0) +--- Attacker before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) +--- Defender before - 6 ArchDevil (ATT:21; DEF:28; THP:1040; LDMG:0) +--- Attacker after - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:495) +--- Defender after - 3 ArchDevil (ATT:21; DEF:28; THP:545; LDMG:0) +--- Attacker before - 3 ArchDevil (ATT:21; DEF:28; THP:545; LDMG:0) +--- Defender before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) +--- Attacker after - 3 ArchDevil (ATT:21; DEF:28; THP:545; LDMG:322.875) +--- Defender after - 5 Archangel (ATT:30; DEF:0; THP:1250; LDMG:0) +--- Attacker before - 5 Archangel (ATT:30; DEF:30; THP:1250; LDMG:0) +--- Defender before - 3 ArchDevil (ATT:21; DEF:28; THP:545; LDMG:0) +--- Attacker after - 5 Archangel (ATT:30; DEF:30; THP:1250; LDMG:412.5) +--- Defender after - 1 ArchDevil (ATT:21; DEF:28; THP:133; LDMG:0) +--- Attacker before - 1 ArchDevil (ATT:21; DEF:28; THP:133; LDMG:0) +--- Defender before - 5 Archangel (ATT:30; DEF:30; THP:1250; LDMG:0) +--- Attacker after - 1 ArchDevil (ATT:21; DEF:28; THP:133; LDMG:107.625) +--- Defender after - 5 Archangel (ATT:30; DEF:0; THP:1250; LDMG:0) +--- Attacker before - 5 Archangel (ATT:30; DEF:30; THP:1250; LDMG:0) +--- Defender before - 1 ArchDevil (ATT:21; DEF:28; THP:133; LDMG:0) +--- Attacker after - 5 Archangel (ATT:30; DEF:30; THP:1250; LDMG:412.5) +--- Defender after - 0 ArchDevil (ATT:21; DEF:28; THP:0; LDMG:0) diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.in.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.in.txt similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.in.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.in.txt index b00a6b9..806ef9c 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.in.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.in.txt @@ -1,14 +1,14 @@ -add 10 Goblin(1) -add 11 Goblin(2) -attack Goblin(1) Goblin(2) -attack Goblin(2) Goblin(1) -attack Goblin(1) Goblin(2) -attack Goblin(2) Goblin(1) -attack Goblin(1) Goblin(2) -attack Goblin(2) Goblin(1) -attack Goblin(1) Goblin(2) -attack Goblin(2) Goblin(1) -attack Goblin(1) Goblin(2) -attack Goblin(2) Goblin(1) -attack Goblin(1) Goblin(2) -exit +add 10 Goblin(1) +add 11 Goblin(2) +attack Goblin(1) Goblin(2) +attack Goblin(2) Goblin(1) +attack Goblin(1) Goblin(2) +attack Goblin(2) Goblin(1) +attack Goblin(1) Goblin(2) +attack Goblin(2) Goblin(1) +attack Goblin(1) Goblin(2) +attack Goblin(2) Goblin(1) +attack Goblin(1) Goblin(2) +attack Goblin(2) Goblin(1) +attack Goblin(1) Goblin(2) +exit diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.out.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.out.txt similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.out.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.out.txt index 9049acd..e31e1cc 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.out.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.out.txt @@ -1,46 +1,46 @@ ---- Creature added to army 1 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] ---- Creature added to army 2 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] ---- Attacker before - 10 Goblin (ATT:4; DEF:2; THP:50; LDMG:0) ---- Defender before - 11 Goblin (ATT:4; DEF:2; THP:55; LDMG:0) ---- Attacker after - 10 Goblin (ATT:4; DEF:2; THP:50; LDMG:16.5) ---- Defender after - 8 Goblin (ATT:4; DEF:2; THP:39; LDMG:0) ---- Attacker before - 8 Goblin (ATT:4; DEF:2; THP:39; LDMG:0) ---- Defender before - 10 Goblin (ATT:4; DEF:2; THP:50; LDMG:0) ---- Attacker after - 8 Goblin (ATT:4; DEF:2; THP:39; LDMG:13.2) ---- Defender after - 8 Goblin (ATT:4; DEF:2; THP:37; LDMG:0) ---- Attacker before - 8 Goblin (ATT:4; DEF:2; THP:37; LDMG:0) ---- Defender before - 8 Goblin (ATT:4; DEF:2; THP:39; LDMG:0) ---- Attacker after - 8 Goblin (ATT:4; DEF:2; THP:37; LDMG:13.2) ---- Defender after - 6 Goblin (ATT:4; DEF:2; THP:26; LDMG:0) ---- Attacker before - 6 Goblin (ATT:4; DEF:2; THP:26; LDMG:0) ---- Defender before - 8 Goblin (ATT:4; DEF:2; THP:37; LDMG:0) ---- Attacker after - 6 Goblin (ATT:4; DEF:2; THP:26; LDMG:9.9) ---- Defender after - 6 Goblin (ATT:4; DEF:2; THP:28; LDMG:0) ---- Attacker before - 6 Goblin (ATT:4; DEF:2; THP:28; LDMG:0) ---- Defender before - 6 Goblin (ATT:4; DEF:2; THP:26; LDMG:0) ---- Attacker after - 6 Goblin (ATT:4; DEF:2; THP:28; LDMG:9.9) ---- Defender after - 4 Goblin (ATT:4; DEF:2; THP:17; LDMG:0) ---- Attacker before - 4 Goblin (ATT:4; DEF:2; THP:17; LDMG:0) ---- Defender before - 6 Goblin (ATT:4; DEF:2; THP:28; LDMG:0) ---- Attacker after - 4 Goblin (ATT:4; DEF:2; THP:17; LDMG:6.6) ---- Defender after - 5 Goblin (ATT:4; DEF:2; THP:22; LDMG:0) ---- Attacker before - 5 Goblin (ATT:4; DEF:2; THP:22; LDMG:0) ---- Defender before - 4 Goblin (ATT:4; DEF:2; THP:17; LDMG:0) ---- Attacker after - 5 Goblin (ATT:4; DEF:2; THP:22; LDMG:8.25) ---- Defender after - 2 Goblin (ATT:4; DEF:2; THP:9; LDMG:0) ---- Attacker before - 2 Goblin (ATT:4; DEF:2; THP:9; LDMG:0) ---- Defender before - 5 Goblin (ATT:4; DEF:2; THP:22; LDMG:0) ---- Attacker after - 2 Goblin (ATT:4; DEF:2; THP:9; LDMG:3.3) ---- Defender after - 4 Goblin (ATT:4; DEF:2; THP:19; LDMG:0) ---- Attacker before - 4 Goblin (ATT:4; DEF:2; THP:19; LDMG:0) ---- Defender before - 2 Goblin (ATT:4; DEF:2; THP:9; LDMG:0) ---- Attacker after - 4 Goblin (ATT:4; DEF:2; THP:19; LDMG:6.6) ---- Defender after - 1 Goblin (ATT:4; DEF:2; THP:3; LDMG:0) ---- Attacker before - 1 Goblin (ATT:4; DEF:2; THP:3; LDMG:0) ---- Defender before - 4 Goblin (ATT:4; DEF:2; THP:19; LDMG:0) ---- Attacker after - 1 Goblin (ATT:4; DEF:2; THP:3; LDMG:1.65) ---- Defender after - 4 Goblin (ATT:4; DEF:2; THP:18; LDMG:0) ---- Attacker before - 4 Goblin (ATT:4; DEF:2; THP:18; LDMG:0) ---- Defender before - 1 Goblin (ATT:4; DEF:2; THP:3; LDMG:0) ---- Attacker after - 4 Goblin (ATT:4; DEF:2; THP:18; LDMG:6.6) ---- Defender after - 0 Goblin (ATT:4; DEF:2; THP:0; LDMG:0) +--- Creature added to army 1 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] +--- Creature added to army 2 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] +--- Attacker before - 10 Goblin (ATT:4; DEF:2; THP:50; LDMG:0) +--- Defender before - 11 Goblin (ATT:4; DEF:2; THP:55; LDMG:0) +--- Attacker after - 10 Goblin (ATT:4; DEF:2; THP:50; LDMG:16.5) +--- Defender after - 8 Goblin (ATT:4; DEF:2; THP:39; LDMG:0) +--- Attacker before - 8 Goblin (ATT:4; DEF:2; THP:39; LDMG:0) +--- Defender before - 10 Goblin (ATT:4; DEF:2; THP:50; LDMG:0) +--- Attacker after - 8 Goblin (ATT:4; DEF:2; THP:39; LDMG:13.2) +--- Defender after - 8 Goblin (ATT:4; DEF:2; THP:37; LDMG:0) +--- Attacker before - 8 Goblin (ATT:4; DEF:2; THP:37; LDMG:0) +--- Defender before - 8 Goblin (ATT:4; DEF:2; THP:39; LDMG:0) +--- Attacker after - 8 Goblin (ATT:4; DEF:2; THP:37; LDMG:13.2) +--- Defender after - 6 Goblin (ATT:4; DEF:2; THP:26; LDMG:0) +--- Attacker before - 6 Goblin (ATT:4; DEF:2; THP:26; LDMG:0) +--- Defender before - 8 Goblin (ATT:4; DEF:2; THP:37; LDMG:0) +--- Attacker after - 6 Goblin (ATT:4; DEF:2; THP:26; LDMG:9.9) +--- Defender after - 6 Goblin (ATT:4; DEF:2; THP:28; LDMG:0) +--- Attacker before - 6 Goblin (ATT:4; DEF:2; THP:28; LDMG:0) +--- Defender before - 6 Goblin (ATT:4; DEF:2; THP:26; LDMG:0) +--- Attacker after - 6 Goblin (ATT:4; DEF:2; THP:28; LDMG:9.9) +--- Defender after - 4 Goblin (ATT:4; DEF:2; THP:17; LDMG:0) +--- Attacker before - 4 Goblin (ATT:4; DEF:2; THP:17; LDMG:0) +--- Defender before - 6 Goblin (ATT:4; DEF:2; THP:28; LDMG:0) +--- Attacker after - 4 Goblin (ATT:4; DEF:2; THP:17; LDMG:6.6) +--- Defender after - 5 Goblin (ATT:4; DEF:2; THP:22; LDMG:0) +--- Attacker before - 5 Goblin (ATT:4; DEF:2; THP:22; LDMG:0) +--- Defender before - 4 Goblin (ATT:4; DEF:2; THP:17; LDMG:0) +--- Attacker after - 5 Goblin (ATT:4; DEF:2; THP:22; LDMG:8.25) +--- Defender after - 2 Goblin (ATT:4; DEF:2; THP:9; LDMG:0) +--- Attacker before - 2 Goblin (ATT:4; DEF:2; THP:9; LDMG:0) +--- Defender before - 5 Goblin (ATT:4; DEF:2; THP:22; LDMG:0) +--- Attacker after - 2 Goblin (ATT:4; DEF:2; THP:9; LDMG:3.3) +--- Defender after - 4 Goblin (ATT:4; DEF:2; THP:19; LDMG:0) +--- Attacker before - 4 Goblin (ATT:4; DEF:2; THP:19; LDMG:0) +--- Defender before - 2 Goblin (ATT:4; DEF:2; THP:9; LDMG:0) +--- Attacker after - 4 Goblin (ATT:4; DEF:2; THP:19; LDMG:6.6) +--- Defender after - 1 Goblin (ATT:4; DEF:2; THP:3; LDMG:0) +--- Attacker before - 1 Goblin (ATT:4; DEF:2; THP:3; LDMG:0) +--- Defender before - 4 Goblin (ATT:4; DEF:2; THP:19; LDMG:0) +--- Attacker after - 1 Goblin (ATT:4; DEF:2; THP:3; LDMG:1.65) +--- Defender after - 4 Goblin (ATT:4; DEF:2; THP:18; LDMG:0) +--- Attacker before - 4 Goblin (ATT:4; DEF:2; THP:18; LDMG:0) +--- Defender before - 1 Goblin (ATT:4; DEF:2; THP:3; LDMG:0) +--- Attacker after - 4 Goblin (ATT:4; DEF:2; THP:18; LDMG:6.6) +--- Defender after - 0 Goblin (ATT:4; DEF:2; THP:0; LDMG:0) diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.in.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.in.txt similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.in.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.in.txt index 78dd059..39097df 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.in.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.in.txt @@ -1,20 +1,20 @@ -add 1000 Goblin(1) -add 10 AncientBehemoth(2) -attack Goblin(1) AncientBehemoth(2) -attack AncientBehemoth(2) Goblin(1) -attack Goblin(1) AncientBehemoth(2) -attack AncientBehemoth(2) Goblin(1) -attack Goblin(1) AncientBehemoth(2) -attack AncientBehemoth(2) Goblin(1) -attack Goblin(1) AncientBehemoth(2) -attack AncientBehemoth(2) Goblin(1) -attack Goblin(1) AncientBehemoth(2) -attack AncientBehemoth(2) Goblin(1) -attack Goblin(1) AncientBehemoth(2) -attack AncientBehemoth(2) Goblin(1) -attack Goblin(1) AncientBehemoth(2) -attack AncientBehemoth(2) Goblin(1) -attack Goblin(1) AncientBehemoth(2) -attack AncientBehemoth(2) Goblin(1) -attack Goblin(1) AncientBehemoth(2) -exit +add 1000 Goblin(1) +add 10 AncientBehemoth(2) +attack Goblin(1) AncientBehemoth(2) +attack AncientBehemoth(2) Goblin(1) +attack Goblin(1) AncientBehemoth(2) +attack AncientBehemoth(2) Goblin(1) +attack Goblin(1) AncientBehemoth(2) +attack AncientBehemoth(2) Goblin(1) +attack Goblin(1) AncientBehemoth(2) +attack AncientBehemoth(2) Goblin(1) +attack Goblin(1) AncientBehemoth(2) +attack AncientBehemoth(2) Goblin(1) +attack Goblin(1) AncientBehemoth(2) +attack AncientBehemoth(2) Goblin(1) +attack Goblin(1) AncientBehemoth(2) +attack AncientBehemoth(2) Goblin(1) +attack Goblin(1) AncientBehemoth(2) +attack AncientBehemoth(2) Goblin(1) +attack Goblin(1) AncientBehemoth(2) +exit diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.out.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.out.txt similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.out.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.out.txt index 481d6e8..8c359cb 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.out.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.out.txt @@ -1,70 +1,70 @@ ---- Creature added to army 1 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] ---- Creature added to army 2 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] ---- Attacker before - 1000 Goblin (ATT:4; DEF:2; THP:5000; LDMG:0) ---- Defender before - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:0) ---- Attacker after - 1000 Goblin (ATT:4; DEF:2; THP:5000; LDMG:450) ---- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2550; LDMG:0) ---- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2550; LDMG:0) ---- Defender before - 1000 Goblin (ATT:4; DEF:2; THP:5000; LDMG:0) ---- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2550; LDMG:684) ---- Defender after - 864 Goblin (ATT:4; DEF:1; THP:4316; LDMG:0) ---- Attacker before - 864 Goblin (ATT:4; DEF:2; THP:4316; LDMG:0) ---- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2550; LDMG:0) ---- Attacker after - 864 Goblin (ATT:4; DEF:2; THP:4316; LDMG:388.8) ---- Defender after - 8 AncientBehemoth (ATT:19; DEF:38; THP:2162; LDMG:0) ---- Attacker before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2162; LDMG:0) ---- Defender before - 864 Goblin (ATT:4; DEF:2; THP:4316; LDMG:0) ---- Attacker after - 8 AncientBehemoth (ATT:19; DEF:19; THP:2162; LDMG:608) ---- Defender after - 742 Goblin (ATT:4; DEF:1; THP:3708; LDMG:0) ---- Attacker before - 742 Goblin (ATT:4; DEF:2; THP:3708; LDMG:0) ---- Defender before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2162; LDMG:0) ---- Attacker after - 742 Goblin (ATT:4; DEF:2; THP:3708; LDMG:333.9) ---- Defender after - 7 AncientBehemoth (ATT:19; DEF:38; THP:1829; LDMG:0) ---- Attacker before - 7 AncientBehemoth (ATT:19; DEF:19; THP:1829; LDMG:0) ---- Defender before - 742 Goblin (ATT:4; DEF:2; THP:3708; LDMG:0) ---- Attacker after - 7 AncientBehemoth (ATT:19; DEF:19; THP:1829; LDMG:532) ---- Defender after - 636 Goblin (ATT:4; DEF:1; THP:3176; LDMG:0) ---- Attacker before - 636 Goblin (ATT:4; DEF:2; THP:3176; LDMG:0) ---- Defender before - 7 AncientBehemoth (ATT:19; DEF:19; THP:1829; LDMG:0) ---- Attacker after - 636 Goblin (ATT:4; DEF:2; THP:3176; LDMG:286.2) ---- Defender after - 6 AncientBehemoth (ATT:19; DEF:38; THP:1543; LDMG:0) ---- Attacker before - 6 AncientBehemoth (ATT:19; DEF:19; THP:1543; LDMG:0) ---- Defender before - 636 Goblin (ATT:4; DEF:2; THP:3176; LDMG:0) ---- Attacker after - 6 AncientBehemoth (ATT:19; DEF:19; THP:1543; LDMG:456) ---- Defender after - 544 Goblin (ATT:4; DEF:1; THP:2720; LDMG:0) ---- Attacker before - 544 Goblin (ATT:4; DEF:2; THP:2720; LDMG:0) ---- Defender before - 6 AncientBehemoth (ATT:19; DEF:19; THP:1543; LDMG:0) ---- Attacker after - 544 Goblin (ATT:4; DEF:2; THP:2720; LDMG:244.8) ---- Defender after - 5 AncientBehemoth (ATT:19; DEF:38; THP:1299; LDMG:0) ---- Attacker before - 5 AncientBehemoth (ATT:19; DEF:19; THP:1299; LDMG:0) ---- Defender before - 544 Goblin (ATT:4; DEF:2; THP:2720; LDMG:0) ---- Attacker after - 5 AncientBehemoth (ATT:19; DEF:19; THP:1299; LDMG:380) ---- Defender after - 468 Goblin (ATT:4; DEF:1; THP:2340; LDMG:0) ---- Attacker before - 468 Goblin (ATT:4; DEF:2; THP:2340; LDMG:0) ---- Defender before - 5 AncientBehemoth (ATT:19; DEF:19; THP:1299; LDMG:0) ---- Attacker after - 468 Goblin (ATT:4; DEF:2; THP:2340; LDMG:438.75) ---- Defender after - 3 AncientBehemoth (ATT:19; DEF:19; THP:861; LDMG:0) ---- Attacker before - 3 AncientBehemoth (ATT:19; DEF:19; THP:861; LDMG:0) ---- Defender before - 468 Goblin (ATT:4; DEF:2; THP:2340; LDMG:0) ---- Attacker after - 3 AncientBehemoth (ATT:19; DEF:19; THP:861; LDMG:228) ---- Defender after - 423 Goblin (ATT:4; DEF:1; THP:2112; LDMG:0) ---- Attacker before - 423 Goblin (ATT:4; DEF:2; THP:2112; LDMG:0) ---- Defender before - 3 AncientBehemoth (ATT:19; DEF:19; THP:861; LDMG:0) ---- Attacker after - 423 Goblin (ATT:4; DEF:2; THP:2112; LDMG:396.5625) ---- Defender after - 2 AncientBehemoth (ATT:19; DEF:19; THP:465; LDMG:0) ---- Attacker before - 2 AncientBehemoth (ATT:19; DEF:19; THP:465; LDMG:0) ---- Defender before - 423 Goblin (ATT:4; DEF:2; THP:2112; LDMG:0) ---- Attacker after - 2 AncientBehemoth (ATT:19; DEF:19; THP:465; LDMG:152) ---- Defender after - 392 Goblin (ATT:4; DEF:1; THP:1960; LDMG:0) ---- Attacker before - 392 Goblin (ATT:4; DEF:2; THP:1960; LDMG:0) ---- Defender before - 2 AncientBehemoth (ATT:19; DEF:19; THP:465; LDMG:0) ---- Attacker after - 392 Goblin (ATT:4; DEF:2; THP:1960; LDMG:367.5) ---- Defender after - 1 AncientBehemoth (ATT:19; DEF:19; THP:98; LDMG:0) ---- Attacker before - 1 AncientBehemoth (ATT:19; DEF:19; THP:98; LDMG:0) ---- Defender before - 392 Goblin (ATT:4; DEF:2; THP:1960; LDMG:0) ---- Attacker after - 1 AncientBehemoth (ATT:19; DEF:19; THP:98; LDMG:76) ---- Defender after - 377 Goblin (ATT:4; DEF:1; THP:1884; LDMG:0) ---- Attacker before - 377 Goblin (ATT:4; DEF:2; THP:1884; LDMG:0) ---- Defender before - 1 AncientBehemoth (ATT:19; DEF:19; THP:98; LDMG:0) ---- Attacker after - 377 Goblin (ATT:4; DEF:2; THP:1884; LDMG:353.4375) ---- Defender after - 0 AncientBehemoth (ATT:19; DEF:19; THP:0; LDMG:0) +--- Creature added to army 1 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] +--- Creature added to army 2 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] +--- Attacker before - 1000 Goblin (ATT:4; DEF:2; THP:5000; LDMG:0) +--- Defender before - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:0) +--- Attacker after - 1000 Goblin (ATT:4; DEF:2; THP:5000; LDMG:450) +--- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2550; LDMG:0) +--- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2550; LDMG:0) +--- Defender before - 1000 Goblin (ATT:4; DEF:2; THP:5000; LDMG:0) +--- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2550; LDMG:684) +--- Defender after - 864 Goblin (ATT:4; DEF:1; THP:4316; LDMG:0) +--- Attacker before - 864 Goblin (ATT:4; DEF:2; THP:4316; LDMG:0) +--- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2550; LDMG:0) +--- Attacker after - 864 Goblin (ATT:4; DEF:2; THP:4316; LDMG:388.8) +--- Defender after - 8 AncientBehemoth (ATT:19; DEF:38; THP:2162; LDMG:0) +--- Attacker before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2162; LDMG:0) +--- Defender before - 864 Goblin (ATT:4; DEF:2; THP:4316; LDMG:0) +--- Attacker after - 8 AncientBehemoth (ATT:19; DEF:19; THP:2162; LDMG:608) +--- Defender after - 742 Goblin (ATT:4; DEF:1; THP:3708; LDMG:0) +--- Attacker before - 742 Goblin (ATT:4; DEF:2; THP:3708; LDMG:0) +--- Defender before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2162; LDMG:0) +--- Attacker after - 742 Goblin (ATT:4; DEF:2; THP:3708; LDMG:333.9) +--- Defender after - 7 AncientBehemoth (ATT:19; DEF:38; THP:1829; LDMG:0) +--- Attacker before - 7 AncientBehemoth (ATT:19; DEF:19; THP:1829; LDMG:0) +--- Defender before - 742 Goblin (ATT:4; DEF:2; THP:3708; LDMG:0) +--- Attacker after - 7 AncientBehemoth (ATT:19; DEF:19; THP:1829; LDMG:532) +--- Defender after - 636 Goblin (ATT:4; DEF:1; THP:3176; LDMG:0) +--- Attacker before - 636 Goblin (ATT:4; DEF:2; THP:3176; LDMG:0) +--- Defender before - 7 AncientBehemoth (ATT:19; DEF:19; THP:1829; LDMG:0) +--- Attacker after - 636 Goblin (ATT:4; DEF:2; THP:3176; LDMG:286.2) +--- Defender after - 6 AncientBehemoth (ATT:19; DEF:38; THP:1543; LDMG:0) +--- Attacker before - 6 AncientBehemoth (ATT:19; DEF:19; THP:1543; LDMG:0) +--- Defender before - 636 Goblin (ATT:4; DEF:2; THP:3176; LDMG:0) +--- Attacker after - 6 AncientBehemoth (ATT:19; DEF:19; THP:1543; LDMG:456) +--- Defender after - 544 Goblin (ATT:4; DEF:1; THP:2720; LDMG:0) +--- Attacker before - 544 Goblin (ATT:4; DEF:2; THP:2720; LDMG:0) +--- Defender before - 6 AncientBehemoth (ATT:19; DEF:19; THP:1543; LDMG:0) +--- Attacker after - 544 Goblin (ATT:4; DEF:2; THP:2720; LDMG:244.8) +--- Defender after - 5 AncientBehemoth (ATT:19; DEF:38; THP:1299; LDMG:0) +--- Attacker before - 5 AncientBehemoth (ATT:19; DEF:19; THP:1299; LDMG:0) +--- Defender before - 544 Goblin (ATT:4; DEF:2; THP:2720; LDMG:0) +--- Attacker after - 5 AncientBehemoth (ATT:19; DEF:19; THP:1299; LDMG:380) +--- Defender after - 468 Goblin (ATT:4; DEF:1; THP:2340; LDMG:0) +--- Attacker before - 468 Goblin (ATT:4; DEF:2; THP:2340; LDMG:0) +--- Defender before - 5 AncientBehemoth (ATT:19; DEF:19; THP:1299; LDMG:0) +--- Attacker after - 468 Goblin (ATT:4; DEF:2; THP:2340; LDMG:438.75) +--- Defender after - 3 AncientBehemoth (ATT:19; DEF:19; THP:861; LDMG:0) +--- Attacker before - 3 AncientBehemoth (ATT:19; DEF:19; THP:861; LDMG:0) +--- Defender before - 468 Goblin (ATT:4; DEF:2; THP:2340; LDMG:0) +--- Attacker after - 3 AncientBehemoth (ATT:19; DEF:19; THP:861; LDMG:228) +--- Defender after - 423 Goblin (ATT:4; DEF:1; THP:2112; LDMG:0) +--- Attacker before - 423 Goblin (ATT:4; DEF:2; THP:2112; LDMG:0) +--- Defender before - 3 AncientBehemoth (ATT:19; DEF:19; THP:861; LDMG:0) +--- Attacker after - 423 Goblin (ATT:4; DEF:2; THP:2112; LDMG:396.5625) +--- Defender after - 2 AncientBehemoth (ATT:19; DEF:19; THP:465; LDMG:0) +--- Attacker before - 2 AncientBehemoth (ATT:19; DEF:19; THP:465; LDMG:0) +--- Defender before - 423 Goblin (ATT:4; DEF:2; THP:2112; LDMG:0) +--- Attacker after - 2 AncientBehemoth (ATT:19; DEF:19; THP:465; LDMG:152) +--- Defender after - 392 Goblin (ATT:4; DEF:1; THP:1960; LDMG:0) +--- Attacker before - 392 Goblin (ATT:4; DEF:2; THP:1960; LDMG:0) +--- Defender before - 2 AncientBehemoth (ATT:19; DEF:19; THP:465; LDMG:0) +--- Attacker after - 392 Goblin (ATT:4; DEF:2; THP:1960; LDMG:367.5) +--- Defender after - 1 AncientBehemoth (ATT:19; DEF:19; THP:98; LDMG:0) +--- Attacker before - 1 AncientBehemoth (ATT:19; DEF:19; THP:98; LDMG:0) +--- Defender before - 392 Goblin (ATT:4; DEF:2; THP:1960; LDMG:0) +--- Attacker after - 1 AncientBehemoth (ATT:19; DEF:19; THP:98; LDMG:76) +--- Defender after - 377 Goblin (ATT:4; DEF:1; THP:1884; LDMG:0) +--- Attacker before - 377 Goblin (ATT:4; DEF:2; THP:1884; LDMG:0) +--- Defender before - 1 AncientBehemoth (ATT:19; DEF:19; THP:98; LDMG:0) +--- Attacker after - 377 Goblin (ATT:4; DEF:2; THP:1884; LDMG:353.4375) +--- Defender after - 0 AncientBehemoth (ATT:19; DEF:19; THP:0; LDMG:0) diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.in.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.in.txt similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.in.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.in.txt index 29866b8..1466ed7 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.in.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.in.txt @@ -1,11 +1,11 @@ -add 10 WolfRaider(1) -add 50 Goblin(2) -attack WolfRaider(1) Goblin(2) -attack Goblin(2) WolfRaider(1) -attack WolfRaider(1) Goblin(2) -attack Goblin(2) WolfRaider(1) -attack WolfRaider(1) Goblin(2) -attack Goblin(2) WolfRaider(1) -attack WolfRaider(1) Goblin(2) -attack Goblin(2) WolfRaider(1) -exit +add 10 WolfRaider(1) +add 50 Goblin(2) +attack WolfRaider(1) Goblin(2) +attack Goblin(2) WolfRaider(1) +attack WolfRaider(1) Goblin(2) +attack Goblin(2) WolfRaider(1) +attack WolfRaider(1) Goblin(2) +attack Goblin(2) WolfRaider(1) +attack WolfRaider(1) Goblin(2) +attack Goblin(2) WolfRaider(1) +exit diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.out.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.out.txt similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.out.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.out.txt index d4b8870..4e230db 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.out.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.out.txt @@ -1,34 +1,34 @@ ---- Creature added to army 1 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] ---- Creature added to army 2 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] ---- Attacker before - 10 WolfRaider (ATT:8; DEF:5; THP:100; LDMG:0) ---- Defender before - 50 Goblin (ATT:4; DEF:2; THP:250; LDMG:0) ---- Attacker after - 10 WolfRaider (ATT:8; DEF:5; THP:100; LDMG:91) ---- Defender after - 32 Goblin (ATT:4; DEF:2; THP:159; LDMG:0) ---- Attacker before - 32 Goblin (ATT:4; DEF:2; THP:159; LDMG:0) ---- Defender before - 10 WolfRaider (ATT:8; DEF:5; THP:100; LDMG:0) ---- Attacker after - 32 Goblin (ATT:4; DEF:2; THP:159; LDMG:46.8) ---- Defender after - 6 WolfRaider (ATT:8; DEF:5; THP:54; LDMG:0) ---- Attacker before - 6 WolfRaider (ATT:8; DEF:5; THP:54; LDMG:0) ---- Defender before - 32 Goblin (ATT:4; DEF:2; THP:159; LDMG:0) ---- Attacker after - 6 WolfRaider (ATT:8; DEF:5; THP:54; LDMG:54.6) ---- Defender after - 21 Goblin (ATT:4; DEF:2; THP:105; LDMG:0) ---- Attacker before - 21 Goblin (ATT:4; DEF:2; THP:105; LDMG:0) ---- Defender before - 6 WolfRaider (ATT:8; DEF:5; THP:54; LDMG:0) ---- Attacker after - 21 Goblin (ATT:4; DEF:2; THP:105; LDMG:30.7125) ---- Defender after - 3 WolfRaider (ATT:8; DEF:5; THP:24; LDMG:0) ---- Attacker before - 3 WolfRaider (ATT:8; DEF:5; THP:24; LDMG:0) ---- Defender before - 21 Goblin (ATT:4; DEF:2; THP:105; LDMG:0) ---- Attacker after - 3 WolfRaider (ATT:8; DEF:5; THP:24; LDMG:27.3) ---- Defender after - 16 Goblin (ATT:4; DEF:2; THP:78; LDMG:0) ---- Attacker before - 16 Goblin (ATT:4; DEF:2; THP:78; LDMG:0) ---- Defender before - 3 WolfRaider (ATT:8; DEF:5; THP:24; LDMG:0) ---- Attacker after - 16 Goblin (ATT:4; DEF:2; THP:78; LDMG:23.4) ---- Defender after - 1 WolfRaider (ATT:8; DEF:5; THP:1; LDMG:0) ---- Attacker before - 1 WolfRaider (ATT:8; DEF:5; THP:1; LDMG:0) ---- Defender before - 16 Goblin (ATT:4; DEF:2; THP:78; LDMG:0) ---- Attacker after - 1 WolfRaider (ATT:8; DEF:5; THP:1; LDMG:9.1) ---- Defender after - 14 Goblin (ATT:4; DEF:2; THP:69; LDMG:0) ---- Attacker before - 14 Goblin (ATT:4; DEF:2; THP:69; LDMG:0) ---- Defender before - 1 WolfRaider (ATT:8; DEF:5; THP:1; LDMG:0) ---- Attacker after - 14 Goblin (ATT:4; DEF:2; THP:69; LDMG:20.475) ---- Defender after - 0 WolfRaider (ATT:8; DEF:5; THP:0; LDMG:0) +--- Creature added to army 1 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] +--- Creature added to army 2 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] +--- Attacker before - 10 WolfRaider (ATT:8; DEF:5; THP:100; LDMG:0) +--- Defender before - 50 Goblin (ATT:4; DEF:2; THP:250; LDMG:0) +--- Attacker after - 10 WolfRaider (ATT:8; DEF:5; THP:100; LDMG:91) +--- Defender after - 32 Goblin (ATT:4; DEF:2; THP:159; LDMG:0) +--- Attacker before - 32 Goblin (ATT:4; DEF:2; THP:159; LDMG:0) +--- Defender before - 10 WolfRaider (ATT:8; DEF:5; THP:100; LDMG:0) +--- Attacker after - 32 Goblin (ATT:4; DEF:2; THP:159; LDMG:46.8) +--- Defender after - 6 WolfRaider (ATT:8; DEF:5; THP:54; LDMG:0) +--- Attacker before - 6 WolfRaider (ATT:8; DEF:5; THP:54; LDMG:0) +--- Defender before - 32 Goblin (ATT:4; DEF:2; THP:159; LDMG:0) +--- Attacker after - 6 WolfRaider (ATT:8; DEF:5; THP:54; LDMG:54.6) +--- Defender after - 21 Goblin (ATT:4; DEF:2; THP:105; LDMG:0) +--- Attacker before - 21 Goblin (ATT:4; DEF:2; THP:105; LDMG:0) +--- Defender before - 6 WolfRaider (ATT:8; DEF:5; THP:54; LDMG:0) +--- Attacker after - 21 Goblin (ATT:4; DEF:2; THP:105; LDMG:30.7125) +--- Defender after - 3 WolfRaider (ATT:8; DEF:5; THP:24; LDMG:0) +--- Attacker before - 3 WolfRaider (ATT:8; DEF:5; THP:24; LDMG:0) +--- Defender before - 21 Goblin (ATT:4; DEF:2; THP:105; LDMG:0) +--- Attacker after - 3 WolfRaider (ATT:8; DEF:5; THP:24; LDMG:27.3) +--- Defender after - 16 Goblin (ATT:4; DEF:2; THP:78; LDMG:0) +--- Attacker before - 16 Goblin (ATT:4; DEF:2; THP:78; LDMG:0) +--- Defender before - 3 WolfRaider (ATT:8; DEF:5; THP:24; LDMG:0) +--- Attacker after - 16 Goblin (ATT:4; DEF:2; THP:78; LDMG:23.4) +--- Defender after - 1 WolfRaider (ATT:8; DEF:5; THP:1; LDMG:0) +--- Attacker before - 1 WolfRaider (ATT:8; DEF:5; THP:1; LDMG:0) +--- Defender before - 16 Goblin (ATT:4; DEF:2; THP:78; LDMG:0) +--- Attacker after - 1 WolfRaider (ATT:8; DEF:5; THP:1; LDMG:9.1) +--- Defender after - 14 Goblin (ATT:4; DEF:2; THP:69; LDMG:0) +--- Attacker before - 14 Goblin (ATT:4; DEF:2; THP:69; LDMG:0) +--- Defender before - 1 WolfRaider (ATT:8; DEF:5; THP:1; LDMG:0) +--- Attacker after - 14 Goblin (ATT:4; DEF:2; THP:69; LDMG:20.475) +--- Defender after - 0 WolfRaider (ATT:8; DEF:5; THP:0; LDMG:0) diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.in.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.in.txt similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.in.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.in.txt index d35bfe3..ca01efd 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.in.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.in.txt @@ -1,19 +1,19 @@ -add 10 AncientBehemoth(1) -add 375 WolfRaider(2) -attack AncientBehemoth(1) WolfRaider(2) -attack WolfRaider(2) AncientBehemoth(1) -attack AncientBehemoth(1) WolfRaider(2) -attack WolfRaider(2) AncientBehemoth(1) -attack AncientBehemoth(1) WolfRaider(2) -attack WolfRaider(2) AncientBehemoth(1) -attack AncientBehemoth(1) WolfRaider(2) -attack WolfRaider(2) AncientBehemoth(1) -attack AncientBehemoth(1) WolfRaider(2) -attack WolfRaider(2) AncientBehemoth(1) -attack AncientBehemoth(1) WolfRaider(2) -attack WolfRaider(2) AncientBehemoth(1) -attack AncientBehemoth(1) WolfRaider(2) -attack WolfRaider(2) AncientBehemoth(1) -attack AncientBehemoth(1) WolfRaider(2) -attack WolfRaider(2) AncientBehemoth(1) -exit +add 10 AncientBehemoth(1) +add 375 WolfRaider(2) +attack AncientBehemoth(1) WolfRaider(2) +attack WolfRaider(2) AncientBehemoth(1) +attack AncientBehemoth(1) WolfRaider(2) +attack WolfRaider(2) AncientBehemoth(1) +attack AncientBehemoth(1) WolfRaider(2) +attack WolfRaider(2) AncientBehemoth(1) +attack AncientBehemoth(1) WolfRaider(2) +attack WolfRaider(2) AncientBehemoth(1) +attack AncientBehemoth(1) WolfRaider(2) +attack WolfRaider(2) AncientBehemoth(1) +attack AncientBehemoth(1) WolfRaider(2) +attack WolfRaider(2) AncientBehemoth(1) +attack AncientBehemoth(1) WolfRaider(2) +attack WolfRaider(2) AncientBehemoth(1) +attack AncientBehemoth(1) WolfRaider(2) +attack WolfRaider(2) AncientBehemoth(1) +exit diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.out.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.out.txt similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.out.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.out.txt index 0681399..aacd888 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.out.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.out.txt @@ -1,66 +1,66 @@ ---- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] ---- Creature added to army 2 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] ---- Attacker before - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:0) ---- Defender before - 375 WolfRaider (ATT:8; DEF:5; THP:3750; LDMG:0) ---- Attacker after - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:760) ---- Defender after - 299 WolfRaider (ATT:8; DEF:1; THP:2990; LDMG:0) ---- Attacker before - 299 WolfRaider (ATT:8; DEF:5; THP:2990; LDMG:0) ---- Defender before - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:0) ---- Attacker after - 299 WolfRaider (ATT:8; DEF:5; THP:2990; LDMG:627.9) ---- Defender after - 8 AncientBehemoth (ATT:19; DEF:38; THP:2373; LDMG:0) ---- Attacker before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2373; LDMG:0) ---- Defender before - 299 WolfRaider (ATT:8; DEF:5; THP:2990; LDMG:0) ---- Attacker after - 8 AncientBehemoth (ATT:19; DEF:19; THP:2373; LDMG:608) ---- Defender after - 239 WolfRaider (ATT:8; DEF:1; THP:2382; LDMG:0) ---- Attacker before - 239 WolfRaider (ATT:8; DEF:5; THP:2382; LDMG:0) ---- Defender before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2373; LDMG:0) ---- Attacker after - 239 WolfRaider (ATT:8; DEF:5; THP:2382; LDMG:501.9) ---- Defender after - 7 AncientBehemoth (ATT:19; DEF:38; THP:1872; LDMG:0) ---- Attacker before - 7 AncientBehemoth (ATT:19; DEF:19; THP:1872; LDMG:0) ---- Defender before - 239 WolfRaider (ATT:8; DEF:5; THP:2382; LDMG:0) ---- Attacker after - 7 AncientBehemoth (ATT:19; DEF:19; THP:1872; LDMG:532) ---- Defender after - 185 WolfRaider (ATT:8; DEF:1; THP:1850; LDMG:0) ---- Attacker before - 185 WolfRaider (ATT:8; DEF:5; THP:1850; LDMG:0) ---- Defender before - 7 AncientBehemoth (ATT:19; DEF:19; THP:1872; LDMG:0) ---- Attacker after - 185 WolfRaider (ATT:8; DEF:5; THP:1850; LDMG:388.5) ---- Defender after - 5 AncientBehemoth (ATT:19; DEF:38; THP:1484; LDMG:0) ---- Attacker before - 5 AncientBehemoth (ATT:19; DEF:19; THP:1484; LDMG:0) ---- Defender before - 185 WolfRaider (ATT:8; DEF:5; THP:1850; LDMG:0) ---- Attacker after - 5 AncientBehemoth (ATT:19; DEF:19; THP:1484; LDMG:380) ---- Defender after - 147 WolfRaider (ATT:8; DEF:1; THP:1470; LDMG:0) ---- Attacker before - 147 WolfRaider (ATT:8; DEF:5; THP:1470; LDMG:0) ---- Defender before - 5 AncientBehemoth (ATT:19; DEF:19; THP:1484; LDMG:0) ---- Attacker after - 147 WolfRaider (ATT:8; DEF:5; THP:1470; LDMG:308.7) ---- Defender after - 4 AncientBehemoth (ATT:19; DEF:38; THP:1176; LDMG:0) ---- Attacker before - 4 AncientBehemoth (ATT:19; DEF:19; THP:1176; LDMG:0) ---- Defender before - 147 WolfRaider (ATT:8; DEF:5; THP:1470; LDMG:0) ---- Attacker after - 4 AncientBehemoth (ATT:19; DEF:19; THP:1176; LDMG:304) ---- Defender after - 117 WolfRaider (ATT:8; DEF:1; THP:1166; LDMG:0) ---- Attacker before - 117 WolfRaider (ATT:8; DEF:5; THP:1166; LDMG:0) ---- Defender before - 4 AncientBehemoth (ATT:19; DEF:19; THP:1176; LDMG:0) ---- Attacker after - 117 WolfRaider (ATT:8; DEF:5; THP:1166; LDMG:245.7) ---- Defender after - 4 AncientBehemoth (ATT:19; DEF:38; THP:931; LDMG:0) ---- Attacker before - 4 AncientBehemoth (ATT:19; DEF:19; THP:931; LDMG:0) ---- Defender before - 117 WolfRaider (ATT:8; DEF:5; THP:1166; LDMG:0) ---- Attacker after - 4 AncientBehemoth (ATT:19; DEF:19; THP:931; LDMG:304) ---- Defender after - 87 WolfRaider (ATT:8; DEF:1; THP:862; LDMG:0) ---- Attacker before - 87 WolfRaider (ATT:8; DEF:5; THP:862; LDMG:0) ---- Defender before - 4 AncientBehemoth (ATT:19; DEF:19; THP:931; LDMG:0) ---- Attacker after - 87 WolfRaider (ATT:8; DEF:5; THP:862; LDMG:441.525) ---- Defender after - 2 AncientBehemoth (ATT:19; DEF:19; THP:490; LDMG:0) ---- Attacker before - 2 AncientBehemoth (ATT:19; DEF:19; THP:490; LDMG:0) ---- Defender before - 87 WolfRaider (ATT:8; DEF:5; THP:862; LDMG:0) ---- Attacker after - 2 AncientBehemoth (ATT:19; DEF:19; THP:490; LDMG:152) ---- Defender after - 71 WolfRaider (ATT:8; DEF:1; THP:710; LDMG:0) ---- Attacker before - 71 WolfRaider (ATT:8; DEF:5; THP:710; LDMG:0) ---- Defender before - 2 AncientBehemoth (ATT:19; DEF:19; THP:490; LDMG:0) ---- Attacker after - 71 WolfRaider (ATT:8; DEF:5; THP:710; LDMG:360.325) ---- Defender after - 1 AncientBehemoth (ATT:19; DEF:19; THP:130; LDMG:0) ---- Attacker before - 1 AncientBehemoth (ATT:19; DEF:19; THP:130; LDMG:0) ---- Defender before - 71 WolfRaider (ATT:8; DEF:5; THP:710; LDMG:0) ---- Attacker after - 1 AncientBehemoth (ATT:19; DEF:19; THP:130; LDMG:76) ---- Defender after - 64 WolfRaider (ATT:8; DEF:1; THP:634; LDMG:0) ---- Attacker before - 64 WolfRaider (ATT:8; DEF:5; THP:634; LDMG:0) ---- Defender before - 1 AncientBehemoth (ATT:19; DEF:19; THP:130; LDMG:0) ---- Attacker after - 64 WolfRaider (ATT:8; DEF:5; THP:634; LDMG:162.4) ---- Defender after - 0 AncientBehemoth (ATT:19; DEF:19; THP:0; LDMG:0) +--- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] +--- Creature added to army 2 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] +--- Attacker before - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:0) +--- Defender before - 375 WolfRaider (ATT:8; DEF:5; THP:3750; LDMG:0) +--- Attacker after - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:760) +--- Defender after - 299 WolfRaider (ATT:8; DEF:1; THP:2990; LDMG:0) +--- Attacker before - 299 WolfRaider (ATT:8; DEF:5; THP:2990; LDMG:0) +--- Defender before - 10 AncientBehemoth (ATT:19; DEF:19; THP:3000; LDMG:0) +--- Attacker after - 299 WolfRaider (ATT:8; DEF:5; THP:2990; LDMG:627.9) +--- Defender after - 8 AncientBehemoth (ATT:19; DEF:38; THP:2373; LDMG:0) +--- Attacker before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2373; LDMG:0) +--- Defender before - 299 WolfRaider (ATT:8; DEF:5; THP:2990; LDMG:0) +--- Attacker after - 8 AncientBehemoth (ATT:19; DEF:19; THP:2373; LDMG:608) +--- Defender after - 239 WolfRaider (ATT:8; DEF:1; THP:2382; LDMG:0) +--- Attacker before - 239 WolfRaider (ATT:8; DEF:5; THP:2382; LDMG:0) +--- Defender before - 8 AncientBehemoth (ATT:19; DEF:19; THP:2373; LDMG:0) +--- Attacker after - 239 WolfRaider (ATT:8; DEF:5; THP:2382; LDMG:501.9) +--- Defender after - 7 AncientBehemoth (ATT:19; DEF:38; THP:1872; LDMG:0) +--- Attacker before - 7 AncientBehemoth (ATT:19; DEF:19; THP:1872; LDMG:0) +--- Defender before - 239 WolfRaider (ATT:8; DEF:5; THP:2382; LDMG:0) +--- Attacker after - 7 AncientBehemoth (ATT:19; DEF:19; THP:1872; LDMG:532) +--- Defender after - 185 WolfRaider (ATT:8; DEF:1; THP:1850; LDMG:0) +--- Attacker before - 185 WolfRaider (ATT:8; DEF:5; THP:1850; LDMG:0) +--- Defender before - 7 AncientBehemoth (ATT:19; DEF:19; THP:1872; LDMG:0) +--- Attacker after - 185 WolfRaider (ATT:8; DEF:5; THP:1850; LDMG:388.5) +--- Defender after - 5 AncientBehemoth (ATT:19; DEF:38; THP:1484; LDMG:0) +--- Attacker before - 5 AncientBehemoth (ATT:19; DEF:19; THP:1484; LDMG:0) +--- Defender before - 185 WolfRaider (ATT:8; DEF:5; THP:1850; LDMG:0) +--- Attacker after - 5 AncientBehemoth (ATT:19; DEF:19; THP:1484; LDMG:380) +--- Defender after - 147 WolfRaider (ATT:8; DEF:1; THP:1470; LDMG:0) +--- Attacker before - 147 WolfRaider (ATT:8; DEF:5; THP:1470; LDMG:0) +--- Defender before - 5 AncientBehemoth (ATT:19; DEF:19; THP:1484; LDMG:0) +--- Attacker after - 147 WolfRaider (ATT:8; DEF:5; THP:1470; LDMG:308.7) +--- Defender after - 4 AncientBehemoth (ATT:19; DEF:38; THP:1176; LDMG:0) +--- Attacker before - 4 AncientBehemoth (ATT:19; DEF:19; THP:1176; LDMG:0) +--- Defender before - 147 WolfRaider (ATT:8; DEF:5; THP:1470; LDMG:0) +--- Attacker after - 4 AncientBehemoth (ATT:19; DEF:19; THP:1176; LDMG:304) +--- Defender after - 117 WolfRaider (ATT:8; DEF:1; THP:1166; LDMG:0) +--- Attacker before - 117 WolfRaider (ATT:8; DEF:5; THP:1166; LDMG:0) +--- Defender before - 4 AncientBehemoth (ATT:19; DEF:19; THP:1176; LDMG:0) +--- Attacker after - 117 WolfRaider (ATT:8; DEF:5; THP:1166; LDMG:245.7) +--- Defender after - 4 AncientBehemoth (ATT:19; DEF:38; THP:931; LDMG:0) +--- Attacker before - 4 AncientBehemoth (ATT:19; DEF:19; THP:931; LDMG:0) +--- Defender before - 117 WolfRaider (ATT:8; DEF:5; THP:1166; LDMG:0) +--- Attacker after - 4 AncientBehemoth (ATT:19; DEF:19; THP:931; LDMG:304) +--- Defender after - 87 WolfRaider (ATT:8; DEF:1; THP:862; LDMG:0) +--- Attacker before - 87 WolfRaider (ATT:8; DEF:5; THP:862; LDMG:0) +--- Defender before - 4 AncientBehemoth (ATT:19; DEF:19; THP:931; LDMG:0) +--- Attacker after - 87 WolfRaider (ATT:8; DEF:5; THP:862; LDMG:441.525) +--- Defender after - 2 AncientBehemoth (ATT:19; DEF:19; THP:490; LDMG:0) +--- Attacker before - 2 AncientBehemoth (ATT:19; DEF:19; THP:490; LDMG:0) +--- Defender before - 87 WolfRaider (ATT:8; DEF:5; THP:862; LDMG:0) +--- Attacker after - 2 AncientBehemoth (ATT:19; DEF:19; THP:490; LDMG:152) +--- Defender after - 71 WolfRaider (ATT:8; DEF:1; THP:710; LDMG:0) +--- Attacker before - 71 WolfRaider (ATT:8; DEF:5; THP:710; LDMG:0) +--- Defender before - 2 AncientBehemoth (ATT:19; DEF:19; THP:490; LDMG:0) +--- Attacker after - 71 WolfRaider (ATT:8; DEF:5; THP:710; LDMG:360.325) +--- Defender after - 1 AncientBehemoth (ATT:19; DEF:19; THP:130; LDMG:0) +--- Attacker before - 1 AncientBehemoth (ATT:19; DEF:19; THP:130; LDMG:0) +--- Defender before - 71 WolfRaider (ATT:8; DEF:5; THP:710; LDMG:0) +--- Attacker after - 1 AncientBehemoth (ATT:19; DEF:19; THP:130; LDMG:76) +--- Defender after - 64 WolfRaider (ATT:8; DEF:1; THP:634; LDMG:0) +--- Attacker before - 64 WolfRaider (ATT:8; DEF:5; THP:634; LDMG:0) +--- Defender before - 1 AncientBehemoth (ATT:19; DEF:19; THP:130; LDMG:0) +--- Attacker after - 64 WolfRaider (ATT:8; DEF:5; THP:634; LDMG:162.4) +--- Defender after - 0 AncientBehemoth (ATT:19; DEF:19; THP:0; LDMG:0) diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.in.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.in.txt similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.in.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.in.txt index 916c483..44250b4 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.in.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.in.txt @@ -1,22 +1,22 @@ -add 101 Griffin(1) -add 11 AncientBehemoth(1) -add 400 WolfRaider(2) -add 51 Goblin(2) -attack AncientBehemoth(1) WolfRaider(2) -attack WolfRaider(2) AncientBehemoth(1) -skip Griffin(1) -attack Goblin(2) AncientBehemoth(1) -attack AncientBehemoth(1) Goblin(2) -attack WolfRaider(2) Griffin(1) -attack Griffin(1) WolfRaider(2) -attack AncientBehemoth(1) WolfRaider(2) -attack WolfRaider(2) Griffin(1) -attack Griffin(1) WolfRaider(2) -attack AncientBehemoth(1) WolfRaider(2) -attack WolfRaider(2) Griffin(1) -attack Griffin(1) WolfRaider(2) -attack AncientBehemoth(1) WolfRaider(2) -attack WolfRaider(2) Griffin(1) -attack Griffin(1) WolfRaider(2) -attack AncientBehemoth(1) WolfRaider(2) -exit +add 101 Griffin(1) +add 11 AncientBehemoth(1) +add 400 WolfRaider(2) +add 51 Goblin(2) +attack AncientBehemoth(1) WolfRaider(2) +attack WolfRaider(2) AncientBehemoth(1) +skip Griffin(1) +attack Goblin(2) AncientBehemoth(1) +attack AncientBehemoth(1) Goblin(2) +attack WolfRaider(2) Griffin(1) +attack Griffin(1) WolfRaider(2) +attack AncientBehemoth(1) WolfRaider(2) +attack WolfRaider(2) Griffin(1) +attack Griffin(1) WolfRaider(2) +attack AncientBehemoth(1) WolfRaider(2) +attack WolfRaider(2) Griffin(1) +attack Griffin(1) WolfRaider(2) +attack AncientBehemoth(1) WolfRaider(2) +attack WolfRaider(2) Griffin(1) +attack Griffin(1) WolfRaider(2) +attack AncientBehemoth(1) WolfRaider(2) +exit diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.out.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.out.txt similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.out.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.out.txt index b304cf7..9ece9f2 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.out.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.out.txt @@ -1,70 +1,70 @@ ---- Creature added to army 1 - Griffin (ATT:8; DEF:8; HP:25; DMG:4.5) [DoubleDefenseWhenDefending(5),AddDefenseWhenSkip(3),Hate(WolfRaider)] ---- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] ---- Creature added to army 2 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] ---- Creature added to army 2 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] ---- Attacker before - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:0) ---- Defender before - 400 WolfRaider (ATT:8; DEF:5; THP:4000; LDMG:0) ---- Attacker after - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:836) ---- Defender after - 317 WolfRaider (ATT:8; DEF:1; THP:3164; LDMG:0) ---- Attacker before - 317 WolfRaider (ATT:8; DEF:5; THP:3164; LDMG:0) ---- Defender before - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:0) ---- Attacker after - 317 WolfRaider (ATT:8; DEF:5; THP:3164; LDMG:665.7) ---- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2635; LDMG:0) ---- Before skip - 101 Griffin (ATT:8; DEF:8; THP:2525; LDMG:0) ---- After skip - 101 Griffin (ATT:8; DEF:14; THP:2525; LDMG:0) ---- Attacker before - 51 Goblin (ATT:4; DEF:2; THP:255; LDMG:0) ---- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2635; LDMG:0) ---- Attacker after - 51 Goblin (ATT:4; DEF:2; THP:255; LDMG:22.95) ---- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2613; LDMG:0) ---- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:0) ---- Defender before - 51 Goblin (ATT:4; DEF:2; THP:255; LDMG:0) ---- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:684) ---- Defender after - 0 Goblin (ATT:4; DEF:1; THP:0; LDMG:0) ---- Attacker before - 317 WolfRaider (ATT:8; DEF:5; THP:3164; LDMG:0) ---- Defender before - 101 Griffin (ATT:8; DEF:14; THP:2525; LDMG:0) ---- Attacker after - 317 WolfRaider (ATT:8; DEF:5; THP:3164; LDMG:1109.5) ---- Defender after - 57 Griffin (ATT:8; DEF:28; THP:1416; LDMG:0) ---- Attacker before - 57 Griffin (ATT:8; DEF:14; THP:1416; LDMG:0) ---- Defender before - 317 WolfRaider (ATT:8; DEF:5; THP:3164; LDMG:0) ---- Attacker after - 57 Griffin (ATT:8; DEF:14; THP:1416; LDMG:442.4625) ---- Defender after - 273 WolfRaider (ATT:8; DEF:5; THP:2722; LDMG:0) ---- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:0) ---- Defender before - 273 WolfRaider (ATT:8; DEF:5; THP:2722; LDMG:0) ---- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:684) ---- Defender after - 204 WolfRaider (ATT:8; DEF:1; THP:2038; LDMG:0) ---- Attacker before - 204 WolfRaider (ATT:8; DEF:5; THP:2038; LDMG:0) ---- Defender before - 57 Griffin (ATT:8; DEF:14; THP:1416; LDMG:0) ---- Attacker after - 204 WolfRaider (ATT:8; DEF:5; THP:2038; LDMG:714) ---- Defender after - 29 Griffin (ATT:8; DEF:28; THP:702; LDMG:0) ---- Attacker before - 29 Griffin (ATT:8; DEF:14; THP:702; LDMG:0) ---- Defender before - 204 WolfRaider (ATT:8; DEF:5; THP:2038; LDMG:0) ---- Attacker after - 29 Griffin (ATT:8; DEF:14; THP:702; LDMG:225.1125) ---- Defender after - 182 WolfRaider (ATT:8; DEF:5; THP:1813; LDMG:0) ---- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:0) ---- Defender before - 182 WolfRaider (ATT:8; DEF:5; THP:1813; LDMG:0) ---- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:684) ---- Defender after - 113 WolfRaider (ATT:8; DEF:1; THP:1129; LDMG:0) ---- Attacker before - 113 WolfRaider (ATT:8; DEF:5; THP:1129; LDMG:0) ---- Defender before - 29 Griffin (ATT:8; DEF:14; THP:702; LDMG:0) ---- Attacker after - 113 WolfRaider (ATT:8; DEF:5; THP:1129; LDMG:395.5) ---- Defender after - 13 Griffin (ATT:8; DEF:28; THP:307; LDMG:0) ---- Attacker before - 13 Griffin (ATT:8; DEF:14; THP:307; LDMG:0) ---- Defender before - 113 WolfRaider (ATT:8; DEF:5; THP:1129; LDMG:0) ---- Attacker after - 13 Griffin (ATT:8; DEF:14; THP:307; LDMG:100.9125) ---- Defender after - 103 WolfRaider (ATT:8; DEF:5; THP:1029; LDMG:0) ---- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:0) ---- Defender before - 103 WolfRaider (ATT:8; DEF:5; THP:1029; LDMG:0) ---- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:684) ---- Defender after - 35 WolfRaider (ATT:8; DEF:1; THP:345; LDMG:0) ---- Attacker before - 35 WolfRaider (ATT:8; DEF:5; THP:345; LDMG:0) ---- Defender before - 13 Griffin (ATT:8; DEF:14; THP:307; LDMG:0) ---- Attacker after - 35 WolfRaider (ATT:8; DEF:5; THP:345; LDMG:122.5) ---- Defender after - 8 Griffin (ATT:8; DEF:28; THP:185; LDMG:0) ---- Attacker before - 8 Griffin (ATT:8; DEF:14; THP:185; LDMG:0) ---- Defender before - 35 WolfRaider (ATT:8; DEF:5; THP:345; LDMG:0) ---- Attacker after - 8 Griffin (ATT:8; DEF:14; THP:185; LDMG:62.1) ---- Defender after - 29 WolfRaider (ATT:8; DEF:5; THP:283; LDMG:0) ---- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:0) ---- Defender before - 29 WolfRaider (ATT:8; DEF:5; THP:283; LDMG:0) ---- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:684) ---- Defender after - 0 WolfRaider (ATT:8; DEF:1; THP:0; LDMG:0) +--- Creature added to army 1 - Griffin (ATT:8; DEF:8; HP:25; DMG:4.5) [DoubleDefenseWhenDefending(5),AddDefenseWhenSkip(3),Hate(WolfRaider)] +--- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] +--- Creature added to army 2 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] +--- Creature added to army 2 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] +--- Attacker before - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:0) +--- Defender before - 400 WolfRaider (ATT:8; DEF:5; THP:4000; LDMG:0) +--- Attacker after - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:836) +--- Defender after - 317 WolfRaider (ATT:8; DEF:1; THP:3164; LDMG:0) +--- Attacker before - 317 WolfRaider (ATT:8; DEF:5; THP:3164; LDMG:0) +--- Defender before - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:0) +--- Attacker after - 317 WolfRaider (ATT:8; DEF:5; THP:3164; LDMG:665.7) +--- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2635; LDMG:0) +--- Before skip - 101 Griffin (ATT:8; DEF:8; THP:2525; LDMG:0) +--- After skip - 101 Griffin (ATT:8; DEF:14; THP:2525; LDMG:0) +--- Attacker before - 51 Goblin (ATT:4; DEF:2; THP:255; LDMG:0) +--- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2635; LDMG:0) +--- Attacker after - 51 Goblin (ATT:4; DEF:2; THP:255; LDMG:22.95) +--- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2613; LDMG:0) +--- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:0) +--- Defender before - 51 Goblin (ATT:4; DEF:2; THP:255; LDMG:0) +--- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:684) +--- Defender after - 0 Goblin (ATT:4; DEF:1; THP:0; LDMG:0) +--- Attacker before - 317 WolfRaider (ATT:8; DEF:5; THP:3164; LDMG:0) +--- Defender before - 101 Griffin (ATT:8; DEF:14; THP:2525; LDMG:0) +--- Attacker after - 317 WolfRaider (ATT:8; DEF:5; THP:3164; LDMG:1109.5) +--- Defender after - 57 Griffin (ATT:8; DEF:28; THP:1416; LDMG:0) +--- Attacker before - 57 Griffin (ATT:8; DEF:14; THP:1416; LDMG:0) +--- Defender before - 317 WolfRaider (ATT:8; DEF:5; THP:3164; LDMG:0) +--- Attacker after - 57 Griffin (ATT:8; DEF:14; THP:1416; LDMG:442.4625) +--- Defender after - 273 WolfRaider (ATT:8; DEF:5; THP:2722; LDMG:0) +--- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:0) +--- Defender before - 273 WolfRaider (ATT:8; DEF:5; THP:2722; LDMG:0) +--- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:684) +--- Defender after - 204 WolfRaider (ATT:8; DEF:1; THP:2038; LDMG:0) +--- Attacker before - 204 WolfRaider (ATT:8; DEF:5; THP:2038; LDMG:0) +--- Defender before - 57 Griffin (ATT:8; DEF:14; THP:1416; LDMG:0) +--- Attacker after - 204 WolfRaider (ATT:8; DEF:5; THP:2038; LDMG:714) +--- Defender after - 29 Griffin (ATT:8; DEF:28; THP:702; LDMG:0) +--- Attacker before - 29 Griffin (ATT:8; DEF:14; THP:702; LDMG:0) +--- Defender before - 204 WolfRaider (ATT:8; DEF:5; THP:2038; LDMG:0) +--- Attacker after - 29 Griffin (ATT:8; DEF:14; THP:702; LDMG:225.1125) +--- Defender after - 182 WolfRaider (ATT:8; DEF:5; THP:1813; LDMG:0) +--- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:0) +--- Defender before - 182 WolfRaider (ATT:8; DEF:5; THP:1813; LDMG:0) +--- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:684) +--- Defender after - 113 WolfRaider (ATT:8; DEF:1; THP:1129; LDMG:0) +--- Attacker before - 113 WolfRaider (ATT:8; DEF:5; THP:1129; LDMG:0) +--- Defender before - 29 Griffin (ATT:8; DEF:14; THP:702; LDMG:0) +--- Attacker after - 113 WolfRaider (ATT:8; DEF:5; THP:1129; LDMG:395.5) +--- Defender after - 13 Griffin (ATT:8; DEF:28; THP:307; LDMG:0) +--- Attacker before - 13 Griffin (ATT:8; DEF:14; THP:307; LDMG:0) +--- Defender before - 113 WolfRaider (ATT:8; DEF:5; THP:1129; LDMG:0) +--- Attacker after - 13 Griffin (ATT:8; DEF:14; THP:307; LDMG:100.9125) +--- Defender after - 103 WolfRaider (ATT:8; DEF:5; THP:1029; LDMG:0) +--- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:0) +--- Defender before - 103 WolfRaider (ATT:8; DEF:5; THP:1029; LDMG:0) +--- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:684) +--- Defender after - 35 WolfRaider (ATT:8; DEF:1; THP:345; LDMG:0) +--- Attacker before - 35 WolfRaider (ATT:8; DEF:5; THP:345; LDMG:0) +--- Defender before - 13 Griffin (ATT:8; DEF:14; THP:307; LDMG:0) +--- Attacker after - 35 WolfRaider (ATT:8; DEF:5; THP:345; LDMG:122.5) +--- Defender after - 8 Griffin (ATT:8; DEF:28; THP:185; LDMG:0) +--- Attacker before - 8 Griffin (ATT:8; DEF:14; THP:185; LDMG:0) +--- Defender before - 35 WolfRaider (ATT:8; DEF:5; THP:345; LDMG:0) +--- Attacker after - 8 Griffin (ATT:8; DEF:14; THP:185; LDMG:62.1) +--- Defender after - 29 WolfRaider (ATT:8; DEF:5; THP:283; LDMG:0) +--- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:0) +--- Defender before - 29 WolfRaider (ATT:8; DEF:5; THP:283; LDMG:0) +--- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2613; LDMG:684) +--- Defender after - 0 WolfRaider (ATT:8; DEF:1; THP:0; LDMG:0) diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.in.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.in.txt similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.in.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.in.txt index 92b2d19..b7160f3 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.in.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.in.txt @@ -1,32 +1,32 @@ -add 10000 Griffin(1) -add 110 AncientBehemoth(1) -add 110 CyclopsKing(1) -add 4000 WolfRaider(2) -add 20000 Goblin(2) -add 110 CyclopsKing(2) -skip AncientBehemoth(1) -skip CyclopsKing(1) -skip CyclopsKing(2) -skip Griffin(1) -skip WolfRaider(2) -skip Goblin(2) -attack AncientBehemoth(1) Goblin(2) -attack CyclopsKing(1) Goblin(2) -attack CyclopsKing(2) AncientBehemoth(1) -attack Griffin(1) Goblin(2) -attack WolfRaider(2) AncientBehemoth(1) -attack Goblin(2) AncientBehemoth(1) -attack AncientBehemoth(1) Goblin(2) -attack CyclopsKing(1) Goblin(2) -attack CyclopsKing(2) AncientBehemoth(1) -attack Griffin(1) Goblin(2) -attack WolfRaider(2) AncientBehemoth(1) -attack AncientBehemoth(1) WolfRaider(2) -attack CyclopsKing(1) WolfRaider(2) -attack CyclopsKing(2) AncientBehemoth(1) -attack Griffin(1) WolfRaider(2) -attack AncientBehemoth(1) CyclopsKing(2) -attack CyclopsKing(1) CyclopsKing(2) -attack CyclopsKing(2) AncientBehemoth(1) -attack Griffin(1) CyclopsKing(2) -exit +add 10000 Griffin(1) +add 110 AncientBehemoth(1) +add 110 CyclopsKing(1) +add 4000 WolfRaider(2) +add 20000 Goblin(2) +add 110 CyclopsKing(2) +skip AncientBehemoth(1) +skip CyclopsKing(1) +skip CyclopsKing(2) +skip Griffin(1) +skip WolfRaider(2) +skip Goblin(2) +attack AncientBehemoth(1) Goblin(2) +attack CyclopsKing(1) Goblin(2) +attack CyclopsKing(2) AncientBehemoth(1) +attack Griffin(1) Goblin(2) +attack WolfRaider(2) AncientBehemoth(1) +attack Goblin(2) AncientBehemoth(1) +attack AncientBehemoth(1) Goblin(2) +attack CyclopsKing(1) Goblin(2) +attack CyclopsKing(2) AncientBehemoth(1) +attack Griffin(1) Goblin(2) +attack WolfRaider(2) AncientBehemoth(1) +attack AncientBehemoth(1) WolfRaider(2) +attack CyclopsKing(1) WolfRaider(2) +attack CyclopsKing(2) AncientBehemoth(1) +attack Griffin(1) WolfRaider(2) +attack AncientBehemoth(1) CyclopsKing(2) +attack CyclopsKing(1) CyclopsKing(2) +attack CyclopsKing(2) AncientBehemoth(1) +attack Griffin(1) CyclopsKing(2) +exit diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.out.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.out.txt similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.out.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.out.txt index c22d4e0..c8c6d51 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.out.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.006.out.txt @@ -1,94 +1,94 @@ ---- Creature added to army 1 - Griffin (ATT:8; DEF:8; HP:25; DMG:4.5) [DoubleDefenseWhenDefending(5),AddDefenseWhenSkip(3),Hate(WolfRaider)] ---- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] ---- Creature added to army 1 - CyclopsKing (ATT:17; DEF:13; HP:70; DMG:18) [AddAttackWhenSkip(3),DoubleAttackWhenAttacking(4),DoubleDamage(1)] ---- Creature added to army 2 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] ---- Creature added to army 2 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] ---- Creature added to army 2 - CyclopsKing (ATT:17; DEF:13; HP:70; DMG:18) [AddAttackWhenSkip(3),DoubleAttackWhenAttacking(4),DoubleDamage(1)] ---- Before skip - 110 AncientBehemoth (ATT:19; DEF:19; THP:33000; LDMG:0) ---- After skip - 110 AncientBehemoth (ATT:19; DEF:22; THP:33000; LDMG:0) ---- Before skip - 110 CyclopsKing (ATT:17; DEF:13; THP:7700; LDMG:0) ---- After skip - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) ---- Before skip - 110 CyclopsKing (ATT:17; DEF:13; THP:7700; LDMG:0) ---- After skip - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) ---- Before skip - 10000 Griffin (ATT:8; DEF:8; THP:250000; LDMG:0) ---- After skip - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) ---- Before skip - 4000 WolfRaider (ATT:8; DEF:5; THP:40000; LDMG:0) ---- After skip - 4000 WolfRaider (ATT:8; DEF:8; THP:40000; LDMG:0) ---- Before skip - 20000 Goblin (ATT:4; DEF:2; THP:100000; LDMG:0) ---- After skip - 20000 Goblin (ATT:4; DEF:5; THP:100000; LDMG:0) ---- Attacker before - 110 AncientBehemoth (ATT:19; DEF:22; THP:33000; LDMG:0) ---- Defender before - 20000 Goblin (ATT:4; DEF:5; THP:100000; LDMG:0) ---- Attacker after - 110 AncientBehemoth (ATT:19; DEF:22; THP:33000; LDMG:8360) ---- Defender after - 18328 Goblin (ATT:4; DEF:1; THP:91640; LDMG:0) ---- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) ---- Defender before - 18328 Goblin (ATT:4; DEF:5; THP:91640; LDMG:0) ---- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:10890) ---- Defender after - 16150 Goblin (ATT:4; DEF:5; THP:80750; LDMG:0) ---- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) ---- Defender before - 110 AncientBehemoth (ATT:19; DEF:22; THP:33000; LDMG:0) ---- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:3564) ---- Defender after - 99 AncientBehemoth (ATT:19; DEF:44; THP:29436; LDMG:0) ---- Attacker before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) ---- Defender before - 16150 Goblin (ATT:4; DEF:5; THP:80750; LDMG:0) ---- Attacker after - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:51750) ---- Defender after - 5800 Goblin (ATT:4; DEF:5; THP:29000; LDMG:0) ---- Attacker before - 4000 WolfRaider (ATT:8; DEF:8; THP:40000; LDMG:0) ---- Defender before - 99 AncientBehemoth (ATT:19; DEF:22; THP:29436; LDMG:0) ---- Attacker after - 4000 WolfRaider (ATT:8; DEF:8; THP:40000; LDMG:8400) ---- Defender after - 71 AncientBehemoth (ATT:19; DEF:44; THP:21036; LDMG:0) ---- Attacker before - 5800 Goblin (ATT:4; DEF:5; THP:29000; LDMG:0) ---- Defender before - 71 AncientBehemoth (ATT:19; DEF:22; THP:21036; LDMG:0) ---- Attacker after - 5800 Goblin (ATT:4; DEF:5; THP:29000; LDMG:2610) ---- Defender after - 62 AncientBehemoth (ATT:19; DEF:44; THP:18426; LDMG:0) ---- Attacker before - 62 AncientBehemoth (ATT:19; DEF:22; THP:18426; LDMG:0) ---- Defender before - 5800 Goblin (ATT:4; DEF:5; THP:29000; LDMG:0) ---- Attacker after - 62 AncientBehemoth (ATT:19; DEF:22; THP:18426; LDMG:4712) ---- Defender after - 4858 Goblin (ATT:4; DEF:1; THP:24288; LDMG:0) ---- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) ---- Defender before - 4858 Goblin (ATT:4; DEF:5; THP:24288; LDMG:0) ---- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:5445) ---- Defender after - 3769 Goblin (ATT:4; DEF:5; THP:18843; LDMG:0) ---- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) ---- Defender before - 62 AncientBehemoth (ATT:19; DEF:22; THP:18426; LDMG:0) ---- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:1782) ---- Defender after - 56 AncientBehemoth (ATT:19; DEF:44; THP:16644; LDMG:0) ---- Attacker before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) ---- Defender before - 3769 Goblin (ATT:4; DEF:5; THP:18843; LDMG:0) ---- Attacker after - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:51750) ---- Defender after - 0 Goblin (ATT:4; DEF:5; THP:0; LDMG:0) ---- Attacker before - 4000 WolfRaider (ATT:8; DEF:8; THP:40000; LDMG:0) ---- Defender before - 56 AncientBehemoth (ATT:19; DEF:22; THP:16644; LDMG:0) ---- Attacker after - 4000 WolfRaider (ATT:8; DEF:8; THP:40000; LDMG:8400) ---- Defender after - 28 AncientBehemoth (ATT:19; DEF:44; THP:8244; LDMG:0) ---- Attacker before - 28 AncientBehemoth (ATT:19; DEF:22; THP:8244; LDMG:0) ---- Defender before - 4000 WolfRaider (ATT:8; DEF:8; THP:40000; LDMG:0) ---- Attacker after - 28 AncientBehemoth (ATT:19; DEF:22; THP:8244; LDMG:2072) ---- Defender after - 3793 WolfRaider (ATT:8; DEF:2; THP:37928; LDMG:0) ---- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) ---- Defender before - 3793 WolfRaider (ATT:8; DEF:8; THP:37928; LDMG:0) ---- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:5148) ---- Defender after - 3278 WolfRaider (ATT:8; DEF:8; THP:32780; LDMG:0) ---- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) ---- Defender before - 28 AncientBehemoth (ATT:19; DEF:22; THP:8244; LDMG:0) ---- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:3762) ---- Defender after - 15 AncientBehemoth (ATT:19; DEF:22; THP:4482; LDMG:0) ---- Attacker before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) ---- Defender before - 3278 WolfRaider (ATT:8; DEF:8; THP:32780; LDMG:0) ---- Attacker after - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:67500) ---- Defender after - 0 WolfRaider (ATT:8; DEF:8; THP:0; LDMG:0) ---- Attacker before - 15 AncientBehemoth (ATT:19; DEF:22; THP:4482; LDMG:0) ---- Defender before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) ---- Attacker after - 15 AncientBehemoth (ATT:19; DEF:22; THP:4482; LDMG:1050) ---- Defender after - 95 CyclopsKing (ATT:20; DEF:4; THP:6650; LDMG:0) ---- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) ---- Defender before - 95 CyclopsKing (ATT:20; DEF:16; THP:6650; LDMG:0) ---- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:4356) ---- Defender after - 33 CyclopsKing (ATT:20; DEF:16; THP:2294; LDMG:0) ---- Attacker before - 33 CyclopsKing (ATT:20; DEF:16; THP:2294; LDMG:0) ---- Defender before - 15 AncientBehemoth (ATT:19; DEF:22; THP:4482; LDMG:0) ---- Attacker after - 33 CyclopsKing (ATT:40; DEF:16; THP:2294; LDMG:1128.6) ---- Defender after - 12 AncientBehemoth (ATT:19; DEF:22; THP:3354; LDMG:0) ---- Attacker before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) ---- Defender before - 33 CyclopsKing (ATT:20; DEF:16; THP:2294; LDMG:0) ---- Attacker after - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:36000) ---- Defender after - 0 CyclopsKing (ATT:20; DEF:16; THP:0; LDMG:0) +--- Creature added to army 1 - Griffin (ATT:8; DEF:8; HP:25; DMG:4.5) [DoubleDefenseWhenDefending(5),AddDefenseWhenSkip(3),Hate(WolfRaider)] +--- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] +--- Creature added to army 1 - CyclopsKing (ATT:17; DEF:13; HP:70; DMG:18) [AddAttackWhenSkip(3),DoubleAttackWhenAttacking(4),DoubleDamage(1)] +--- Creature added to army 2 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] +--- Creature added to army 2 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] +--- Creature added to army 2 - CyclopsKing (ATT:17; DEF:13; HP:70; DMG:18) [AddAttackWhenSkip(3),DoubleAttackWhenAttacking(4),DoubleDamage(1)] +--- Before skip - 110 AncientBehemoth (ATT:19; DEF:19; THP:33000; LDMG:0) +--- After skip - 110 AncientBehemoth (ATT:19; DEF:22; THP:33000; LDMG:0) +--- Before skip - 110 CyclopsKing (ATT:17; DEF:13; THP:7700; LDMG:0) +--- After skip - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) +--- Before skip - 110 CyclopsKing (ATT:17; DEF:13; THP:7700; LDMG:0) +--- After skip - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) +--- Before skip - 10000 Griffin (ATT:8; DEF:8; THP:250000; LDMG:0) +--- After skip - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) +--- Before skip - 4000 WolfRaider (ATT:8; DEF:5; THP:40000; LDMG:0) +--- After skip - 4000 WolfRaider (ATT:8; DEF:8; THP:40000; LDMG:0) +--- Before skip - 20000 Goblin (ATT:4; DEF:2; THP:100000; LDMG:0) +--- After skip - 20000 Goblin (ATT:4; DEF:5; THP:100000; LDMG:0) +--- Attacker before - 110 AncientBehemoth (ATT:19; DEF:22; THP:33000; LDMG:0) +--- Defender before - 20000 Goblin (ATT:4; DEF:5; THP:100000; LDMG:0) +--- Attacker after - 110 AncientBehemoth (ATT:19; DEF:22; THP:33000; LDMG:8360) +--- Defender after - 18328 Goblin (ATT:4; DEF:1; THP:91640; LDMG:0) +--- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) +--- Defender before - 18328 Goblin (ATT:4; DEF:5; THP:91640; LDMG:0) +--- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:10890) +--- Defender after - 16150 Goblin (ATT:4; DEF:5; THP:80750; LDMG:0) +--- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) +--- Defender before - 110 AncientBehemoth (ATT:19; DEF:22; THP:33000; LDMG:0) +--- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:3564) +--- Defender after - 99 AncientBehemoth (ATT:19; DEF:44; THP:29436; LDMG:0) +--- Attacker before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) +--- Defender before - 16150 Goblin (ATT:4; DEF:5; THP:80750; LDMG:0) +--- Attacker after - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:51750) +--- Defender after - 5800 Goblin (ATT:4; DEF:5; THP:29000; LDMG:0) +--- Attacker before - 4000 WolfRaider (ATT:8; DEF:8; THP:40000; LDMG:0) +--- Defender before - 99 AncientBehemoth (ATT:19; DEF:22; THP:29436; LDMG:0) +--- Attacker after - 4000 WolfRaider (ATT:8; DEF:8; THP:40000; LDMG:8400) +--- Defender after - 71 AncientBehemoth (ATT:19; DEF:44; THP:21036; LDMG:0) +--- Attacker before - 5800 Goblin (ATT:4; DEF:5; THP:29000; LDMG:0) +--- Defender before - 71 AncientBehemoth (ATT:19; DEF:22; THP:21036; LDMG:0) +--- Attacker after - 5800 Goblin (ATT:4; DEF:5; THP:29000; LDMG:2610) +--- Defender after - 62 AncientBehemoth (ATT:19; DEF:44; THP:18426; LDMG:0) +--- Attacker before - 62 AncientBehemoth (ATT:19; DEF:22; THP:18426; LDMG:0) +--- Defender before - 5800 Goblin (ATT:4; DEF:5; THP:29000; LDMG:0) +--- Attacker after - 62 AncientBehemoth (ATT:19; DEF:22; THP:18426; LDMG:4712) +--- Defender after - 4858 Goblin (ATT:4; DEF:1; THP:24288; LDMG:0) +--- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) +--- Defender before - 4858 Goblin (ATT:4; DEF:5; THP:24288; LDMG:0) +--- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:5445) +--- Defender after - 3769 Goblin (ATT:4; DEF:5; THP:18843; LDMG:0) +--- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) +--- Defender before - 62 AncientBehemoth (ATT:19; DEF:22; THP:18426; LDMG:0) +--- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:1782) +--- Defender after - 56 AncientBehemoth (ATT:19; DEF:44; THP:16644; LDMG:0) +--- Attacker before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) +--- Defender before - 3769 Goblin (ATT:4; DEF:5; THP:18843; LDMG:0) +--- Attacker after - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:51750) +--- Defender after - 0 Goblin (ATT:4; DEF:5; THP:0; LDMG:0) +--- Attacker before - 4000 WolfRaider (ATT:8; DEF:8; THP:40000; LDMG:0) +--- Defender before - 56 AncientBehemoth (ATT:19; DEF:22; THP:16644; LDMG:0) +--- Attacker after - 4000 WolfRaider (ATT:8; DEF:8; THP:40000; LDMG:8400) +--- Defender after - 28 AncientBehemoth (ATT:19; DEF:44; THP:8244; LDMG:0) +--- Attacker before - 28 AncientBehemoth (ATT:19; DEF:22; THP:8244; LDMG:0) +--- Defender before - 4000 WolfRaider (ATT:8; DEF:8; THP:40000; LDMG:0) +--- Attacker after - 28 AncientBehemoth (ATT:19; DEF:22; THP:8244; LDMG:2072) +--- Defender after - 3793 WolfRaider (ATT:8; DEF:2; THP:37928; LDMG:0) +--- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) +--- Defender before - 3793 WolfRaider (ATT:8; DEF:8; THP:37928; LDMG:0) +--- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:5148) +--- Defender after - 3278 WolfRaider (ATT:8; DEF:8; THP:32780; LDMG:0) +--- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) +--- Defender before - 28 AncientBehemoth (ATT:19; DEF:22; THP:8244; LDMG:0) +--- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:3762) +--- Defender after - 15 AncientBehemoth (ATT:19; DEF:22; THP:4482; LDMG:0) +--- Attacker before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) +--- Defender before - 3278 WolfRaider (ATT:8; DEF:8; THP:32780; LDMG:0) +--- Attacker after - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:67500) +--- Defender after - 0 WolfRaider (ATT:8; DEF:8; THP:0; LDMG:0) +--- Attacker before - 15 AncientBehemoth (ATT:19; DEF:22; THP:4482; LDMG:0) +--- Defender before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) +--- Attacker after - 15 AncientBehemoth (ATT:19; DEF:22; THP:4482; LDMG:1050) +--- Defender after - 95 CyclopsKing (ATT:20; DEF:4; THP:6650; LDMG:0) +--- Attacker before - 110 CyclopsKing (ATT:20; DEF:16; THP:7700; LDMG:0) +--- Defender before - 95 CyclopsKing (ATT:20; DEF:16; THP:6650; LDMG:0) +--- Attacker after - 110 CyclopsKing (ATT:40; DEF:16; THP:7700; LDMG:4356) +--- Defender after - 33 CyclopsKing (ATT:20; DEF:16; THP:2294; LDMG:0) +--- Attacker before - 33 CyclopsKing (ATT:20; DEF:16; THP:2294; LDMG:0) +--- Defender before - 15 AncientBehemoth (ATT:19; DEF:22; THP:4482; LDMG:0) +--- Attacker after - 33 CyclopsKing (ATT:40; DEF:16; THP:2294; LDMG:1128.6) +--- Defender after - 12 AncientBehemoth (ATT:19; DEF:22; THP:3354; LDMG:0) +--- Attacker before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) +--- Defender before - 33 CyclopsKing (ATT:20; DEF:16; THP:2294; LDMG:0) +--- Attacker after - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:36000) +--- Defender after - 0 CyclopsKing (ATT:20; DEF:16; THP:0; LDMG:0) diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.in.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.in.txt similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.in.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.in.txt index 4886c64..90c724a 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.in.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.in.txt @@ -1,32 +1,32 @@ -add 11 AncientBehemoth(1) -add 101 WolfRaider(1) -add 101 Goblin(1) -add 11 CyclopsKing(2) -add 51 Griffin(2) -add 11 Archangel(2) -attack Archangel(2) Goblin(1) -attack AncientBehemoth(1) Archangel(2) -attack Griffin(2) WolfRaider(1) -attack WolfRaider(1) Griffin(2) -skip CyclopsKing(2) -attack Archangel(2) WolfRaider(1) -attack AncientBehemoth(1) Archangel(2) -attack Griffin(2) AncientBehemoth(1) -attack CyclopsKing(2) AncientBehemoth(1) -attack Archangel(2) AncientBehemoth(1) -attack AncientBehemoth(1) CyclopsKing(2) -attack Griffin(2) AncientBehemoth(1) -attack CyclopsKing(2) AncientBehemoth(1) -attack Archangel(2) AncientBehemoth(1) -attack AncientBehemoth(1) CyclopsKing(2) -attack Griffin(2) AncientBehemoth(1) -attack Archangel(2) AncientBehemoth(1) -attack AncientBehemoth(1) Griffin(2) -attack Griffin(2) AncientBehemoth(1) -attack Archangel(2) AncientBehemoth(1) -attack AncientBehemoth(1) Griffin(2) -attack Griffin(2) AncientBehemoth(1) -attack Archangel(2) AncientBehemoth(1) -attack AncientBehemoth(1) Griffin(2) -attack Griffin(2) AncientBehemoth(1) -exit +add 11 AncientBehemoth(1) +add 101 WolfRaider(1) +add 101 Goblin(1) +add 11 CyclopsKing(2) +add 51 Griffin(2) +add 11 Archangel(2) +attack Archangel(2) Goblin(1) +attack AncientBehemoth(1) Archangel(2) +attack Griffin(2) WolfRaider(1) +attack WolfRaider(1) Griffin(2) +skip CyclopsKing(2) +attack Archangel(2) WolfRaider(1) +attack AncientBehemoth(1) Archangel(2) +attack Griffin(2) AncientBehemoth(1) +attack CyclopsKing(2) AncientBehemoth(1) +attack Archangel(2) AncientBehemoth(1) +attack AncientBehemoth(1) CyclopsKing(2) +attack Griffin(2) AncientBehemoth(1) +attack CyclopsKing(2) AncientBehemoth(1) +attack Archangel(2) AncientBehemoth(1) +attack AncientBehemoth(1) CyclopsKing(2) +attack Griffin(2) AncientBehemoth(1) +attack Archangel(2) AncientBehemoth(1) +attack AncientBehemoth(1) Griffin(2) +attack Griffin(2) AncientBehemoth(1) +attack Archangel(2) AncientBehemoth(1) +attack AncientBehemoth(1) Griffin(2) +attack Griffin(2) AncientBehemoth(1) +attack Archangel(2) AncientBehemoth(1) +attack AncientBehemoth(1) Griffin(2) +attack Griffin(2) AncientBehemoth(1) +exit diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.out.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.out.txt similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.out.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.out.txt index f319b80..1ffe80e 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.out.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.007.out.txt @@ -1,104 +1,104 @@ ---- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] ---- Creature added to army 1 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] ---- Creature added to army 1 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] ---- Creature added to army 2 - CyclopsKing (ATT:17; DEF:13; HP:70; DMG:18) [AddAttackWhenSkip(3),DoubleAttackWhenAttacking(4),DoubleDamage(1)] ---- Creature added to army 2 - Griffin (ATT:8; DEF:8; HP:25; DMG:4.5) [DoubleDefenseWhenDefending(5),AddDefenseWhenSkip(3),Hate(WolfRaider)] ---- Creature added to army 2 - Archangel (ATT:30; DEF:30; HP:250; DMG:50) [Hate(Devil),Hate(ArchDevil),Resurrection] ---- Attacker before - 11 Archangel (ATT:30; DEF:30; THP:2750; LDMG:0) ---- Defender before - 101 Goblin (ATT:4; DEF:2; THP:505; LDMG:0) ---- Attacker after - 11 Archangel (ATT:30; DEF:30; THP:2750; LDMG:1320) ---- Defender after - 0 Goblin (ATT:4; DEF:2; THP:0; LDMG:0) ---- Attacker before - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:0) ---- Defender before - 11 Archangel (ATT:30; DEF:30; THP:2750; LDMG:0) ---- Attacker after - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:726) ---- Defender after - 9 Archangel (ATT:30; DEF:6; THP:2250; LDMG:0) ---- Attacker before - 51 Griffin (ATT:8; DEF:8; THP:1275; LDMG:0) ---- Defender before - 101 WolfRaider (ATT:8; DEF:5; THP:1010; LDMG:0) ---- Attacker after - 51 Griffin (ATT:8; DEF:8; THP:1275; LDMG:395.8875) ---- Defender after - 62 WolfRaider (ATT:8; DEF:5; THP:615; LDMG:0) ---- Attacker before - 62 WolfRaider (ATT:8; DEF:5; THP:615; LDMG:0) ---- Defender before - 51 Griffin (ATT:8; DEF:8; THP:1275; LDMG:0) ---- Attacker after - 62 WolfRaider (ATT:8; DEF:5; THP:615; LDMG:347.2) ---- Defender after - 38 Griffin (ATT:8; DEF:16; THP:928; LDMG:0) ---- Before skip - 11 CyclopsKing (ATT:17; DEF:13; THP:770; LDMG:0) ---- After skip - 11 CyclopsKing (ATT:20; DEF:16; THP:770; LDMG:0) ---- Attacker before - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:0) ---- Defender before - 62 WolfRaider (ATT:8; DEF:5; THP:615; LDMG:0) ---- Attacker after - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:1012.5) ---- Defender after - 0 WolfRaider (ATT:8; DEF:5; THP:0; LDMG:0) ---- Attacker before - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:0) ---- Defender before - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:0) ---- Attacker after - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:726) ---- Defender after - 7 Archangel (ATT:30; DEF:6; THP:1750; LDMG:0) ---- Attacker before - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:0) ---- Defender before - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:0) ---- Attacker after - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:51.3) ---- Defender after - 11 AncientBehemoth (ATT:19; DEF:38; THP:3249; LDMG:0) ---- Attacker before - 11 CyclopsKing (ATT:20; DEF:16; THP:770; LDMG:0) ---- Defender before - 11 AncientBehemoth (ATT:19; DEF:19; THP:3249; LDMG:0) ---- Attacker after - 11 CyclopsKing (ATT:40; DEF:16; THP:770; LDMG:435.6) ---- Defender after - 10 AncientBehemoth (ATT:19; DEF:38; THP:2814; LDMG:0) ---- Attacker before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) ---- Defender before - 10 AncientBehemoth (ATT:19; DEF:19; THP:2814; LDMG:0) ---- Attacker after - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:280) ---- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2534; LDMG:0) ---- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2534; LDMG:0) ---- Defender before - 11 CyclopsKing (ATT:20; DEF:16; THP:770; LDMG:0) ---- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2534; LDMG:630) ---- Defender after - 2 CyclopsKing (ATT:20; DEF:4; THP:140; LDMG:0) ---- Attacker before - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:0) ---- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2534; LDMG:0) ---- Attacker after - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:51.3) ---- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2483; LDMG:0) ---- Attacker before - 2 CyclopsKing (ATT:20; DEF:16; THP:140; LDMG:0) ---- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2483; LDMG:0) ---- Attacker after - 2 CyclopsKing (ATT:40; DEF:16; THP:140; LDMG:39.6) ---- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2444; LDMG:0) ---- Attacker before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) ---- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2444; LDMG:0) ---- Attacker after - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:542.5) ---- Defender after - 7 AncientBehemoth (ATT:19; DEF:19; THP:1902; LDMG:0) ---- Attacker before - 7 AncientBehemoth (ATT:19; DEF:19; THP:1902; LDMG:0) ---- Defender before - 2 CyclopsKing (ATT:20; DEF:16; THP:140; LDMG:0) ---- Attacker after - 7 AncientBehemoth (ATT:19; DEF:19; THP:1902; LDMG:490) ---- Defender after - 0 CyclopsKing (ATT:20; DEF:4; THP:0; LDMG:0) ---- Attacker before - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:0) ---- Defender before - 7 AncientBehemoth (ATT:19; DEF:19; THP:1902; LDMG:0) ---- Attacker after - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:123.975) ---- Defender after - 6 AncientBehemoth (ATT:19; DEF:19; THP:1779; LDMG:0) ---- Attacker before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) ---- Defender before - 6 AncientBehemoth (ATT:19; DEF:19; THP:1779; LDMG:0) ---- Attacker after - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:542.5) ---- Defender after - 5 AncientBehemoth (ATT:19; DEF:19; THP:1237; LDMG:0) ---- Attacker before - 5 AncientBehemoth (ATT:19; DEF:19; THP:1237; LDMG:0) ---- Defender before - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:0) ---- Attacker after - 5 AncientBehemoth (ATT:19; DEF:19; THP:1237; LDMG:350) ---- Defender after - 24 Griffin (ATT:8; DEF:4; THP:578; LDMG:0) ---- Attacker before - 24 Griffin (ATT:8; DEF:8; THP:578; LDMG:0) ---- Defender before - 5 AncientBehemoth (ATT:19; DEF:19; THP:1237; LDMG:0) ---- Attacker after - 24 Griffin (ATT:8; DEF:8; THP:578; LDMG:78.3) ---- Defender after - 4 AncientBehemoth (ATT:19; DEF:19; THP:1159; LDMG:0) ---- Attacker before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) ---- Defender before - 4 AncientBehemoth (ATT:19; DEF:19; THP:1159; LDMG:0) ---- Attacker after - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:542.5) ---- Defender after - 3 AncientBehemoth (ATT:19; DEF:19; THP:617; LDMG:0) ---- Attacker before - 3 AncientBehemoth (ATT:19; DEF:19; THP:617; LDMG:0) ---- Defender before - 24 Griffin (ATT:8; DEF:8; THP:578; LDMG:0) ---- Attacker after - 3 AncientBehemoth (ATT:19; DEF:19; THP:617; LDMG:210) ---- Defender after - 15 Griffin (ATT:8; DEF:4; THP:368; LDMG:0) ---- Attacker before - 15 Griffin (ATT:8; DEF:8; THP:368; LDMG:0) ---- Defender before - 3 AncientBehemoth (ATT:19; DEF:19; THP:617; LDMG:0) ---- Attacker after - 15 Griffin (ATT:8; DEF:8; THP:368; LDMG:48.9375) ---- Defender after - 2 AncientBehemoth (ATT:19; DEF:19; THP:569; LDMG:0) ---- Attacker before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) ---- Defender before - 2 AncientBehemoth (ATT:19; DEF:19; THP:569; LDMG:0) ---- Attacker after - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:542.5) ---- Defender after - 1 AncientBehemoth (ATT:19; DEF:19; THP:27; LDMG:0) ---- Attacker before - 1 AncientBehemoth (ATT:19; DEF:19; THP:27; LDMG:0) ---- Defender before - 15 Griffin (ATT:8; DEF:8; THP:368; LDMG:0) ---- Attacker after - 1 AncientBehemoth (ATT:19; DEF:19; THP:27; LDMG:70) ---- Defender after - 12 Griffin (ATT:8; DEF:4; THP:298; LDMG:0) ---- Attacker before - 12 Griffin (ATT:8; DEF:8; THP:298; LDMG:0) ---- Defender before - 1 AncientBehemoth (ATT:19; DEF:19; THP:27; LDMG:0) ---- Attacker after - 12 Griffin (ATT:8; DEF:8; THP:298; LDMG:39.15) ---- Defender after - 0 AncientBehemoth (ATT:19; DEF:19; THP:0; LDMG:0) +--- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] +--- Creature added to army 1 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] +--- Creature added to army 1 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] +--- Creature added to army 2 - CyclopsKing (ATT:17; DEF:13; HP:70; DMG:18) [AddAttackWhenSkip(3),DoubleAttackWhenAttacking(4),DoubleDamage(1)] +--- Creature added to army 2 - Griffin (ATT:8; DEF:8; HP:25; DMG:4.5) [DoubleDefenseWhenDefending(5),AddDefenseWhenSkip(3),Hate(WolfRaider)] +--- Creature added to army 2 - Archangel (ATT:30; DEF:30; HP:250; DMG:50) [Hate(Devil),Hate(ArchDevil),Resurrection] +--- Attacker before - 11 Archangel (ATT:30; DEF:30; THP:2750; LDMG:0) +--- Defender before - 101 Goblin (ATT:4; DEF:2; THP:505; LDMG:0) +--- Attacker after - 11 Archangel (ATT:30; DEF:30; THP:2750; LDMG:1320) +--- Defender after - 0 Goblin (ATT:4; DEF:2; THP:0; LDMG:0) +--- Attacker before - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:0) +--- Defender before - 11 Archangel (ATT:30; DEF:30; THP:2750; LDMG:0) +--- Attacker after - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:726) +--- Defender after - 9 Archangel (ATT:30; DEF:6; THP:2250; LDMG:0) +--- Attacker before - 51 Griffin (ATT:8; DEF:8; THP:1275; LDMG:0) +--- Defender before - 101 WolfRaider (ATT:8; DEF:5; THP:1010; LDMG:0) +--- Attacker after - 51 Griffin (ATT:8; DEF:8; THP:1275; LDMG:395.8875) +--- Defender after - 62 WolfRaider (ATT:8; DEF:5; THP:615; LDMG:0) +--- Attacker before - 62 WolfRaider (ATT:8; DEF:5; THP:615; LDMG:0) +--- Defender before - 51 Griffin (ATT:8; DEF:8; THP:1275; LDMG:0) +--- Attacker after - 62 WolfRaider (ATT:8; DEF:5; THP:615; LDMG:347.2) +--- Defender after - 38 Griffin (ATT:8; DEF:16; THP:928; LDMG:0) +--- Before skip - 11 CyclopsKing (ATT:17; DEF:13; THP:770; LDMG:0) +--- After skip - 11 CyclopsKing (ATT:20; DEF:16; THP:770; LDMG:0) +--- Attacker before - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:0) +--- Defender before - 62 WolfRaider (ATT:8; DEF:5; THP:615; LDMG:0) +--- Attacker after - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:1012.5) +--- Defender after - 0 WolfRaider (ATT:8; DEF:5; THP:0; LDMG:0) +--- Attacker before - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:0) +--- Defender before - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:0) +--- Attacker after - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:726) +--- Defender after - 7 Archangel (ATT:30; DEF:6; THP:1750; LDMG:0) +--- Attacker before - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:0) +--- Defender before - 11 AncientBehemoth (ATT:19; DEF:19; THP:3300; LDMG:0) +--- Attacker after - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:51.3) +--- Defender after - 11 AncientBehemoth (ATT:19; DEF:38; THP:3249; LDMG:0) +--- Attacker before - 11 CyclopsKing (ATT:20; DEF:16; THP:770; LDMG:0) +--- Defender before - 11 AncientBehemoth (ATT:19; DEF:19; THP:3249; LDMG:0) +--- Attacker after - 11 CyclopsKing (ATT:40; DEF:16; THP:770; LDMG:435.6) +--- Defender after - 10 AncientBehemoth (ATT:19; DEF:38; THP:2814; LDMG:0) +--- Attacker before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) +--- Defender before - 10 AncientBehemoth (ATT:19; DEF:19; THP:2814; LDMG:0) +--- Attacker after - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:280) +--- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2534; LDMG:0) +--- Attacker before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2534; LDMG:0) +--- Defender before - 11 CyclopsKing (ATT:20; DEF:16; THP:770; LDMG:0) +--- Attacker after - 9 AncientBehemoth (ATT:19; DEF:19; THP:2534; LDMG:630) +--- Defender after - 2 CyclopsKing (ATT:20; DEF:4; THP:140; LDMG:0) +--- Attacker before - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:0) +--- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2534; LDMG:0) +--- Attacker after - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:51.3) +--- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2483; LDMG:0) +--- Attacker before - 2 CyclopsKing (ATT:20; DEF:16; THP:140; LDMG:0) +--- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2483; LDMG:0) +--- Attacker after - 2 CyclopsKing (ATT:40; DEF:16; THP:140; LDMG:39.6) +--- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2444; LDMG:0) +--- Attacker before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) +--- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2444; LDMG:0) +--- Attacker after - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:542.5) +--- Defender after - 7 AncientBehemoth (ATT:19; DEF:19; THP:1902; LDMG:0) +--- Attacker before - 7 AncientBehemoth (ATT:19; DEF:19; THP:1902; LDMG:0) +--- Defender before - 2 CyclopsKing (ATT:20; DEF:16; THP:140; LDMG:0) +--- Attacker after - 7 AncientBehemoth (ATT:19; DEF:19; THP:1902; LDMG:490) +--- Defender after - 0 CyclopsKing (ATT:20; DEF:4; THP:0; LDMG:0) +--- Attacker before - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:0) +--- Defender before - 7 AncientBehemoth (ATT:19; DEF:19; THP:1902; LDMG:0) +--- Attacker after - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:123.975) +--- Defender after - 6 AncientBehemoth (ATT:19; DEF:19; THP:1779; LDMG:0) +--- Attacker before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) +--- Defender before - 6 AncientBehemoth (ATT:19; DEF:19; THP:1779; LDMG:0) +--- Attacker after - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:542.5) +--- Defender after - 5 AncientBehemoth (ATT:19; DEF:19; THP:1237; LDMG:0) +--- Attacker before - 5 AncientBehemoth (ATT:19; DEF:19; THP:1237; LDMG:0) +--- Defender before - 38 Griffin (ATT:8; DEF:8; THP:928; LDMG:0) +--- Attacker after - 5 AncientBehemoth (ATT:19; DEF:19; THP:1237; LDMG:350) +--- Defender after - 24 Griffin (ATT:8; DEF:4; THP:578; LDMG:0) +--- Attacker before - 24 Griffin (ATT:8; DEF:8; THP:578; LDMG:0) +--- Defender before - 5 AncientBehemoth (ATT:19; DEF:19; THP:1237; LDMG:0) +--- Attacker after - 24 Griffin (ATT:8; DEF:8; THP:578; LDMG:78.3) +--- Defender after - 4 AncientBehemoth (ATT:19; DEF:19; THP:1159; LDMG:0) +--- Attacker before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) +--- Defender before - 4 AncientBehemoth (ATT:19; DEF:19; THP:1159; LDMG:0) +--- Attacker after - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:542.5) +--- Defender after - 3 AncientBehemoth (ATT:19; DEF:19; THP:617; LDMG:0) +--- Attacker before - 3 AncientBehemoth (ATT:19; DEF:19; THP:617; LDMG:0) +--- Defender before - 24 Griffin (ATT:8; DEF:8; THP:578; LDMG:0) +--- Attacker after - 3 AncientBehemoth (ATT:19; DEF:19; THP:617; LDMG:210) +--- Defender after - 15 Griffin (ATT:8; DEF:4; THP:368; LDMG:0) +--- Attacker before - 15 Griffin (ATT:8; DEF:8; THP:368; LDMG:0) +--- Defender before - 3 AncientBehemoth (ATT:19; DEF:19; THP:617; LDMG:0) +--- Attacker after - 15 Griffin (ATT:8; DEF:8; THP:368; LDMG:48.9375) +--- Defender after - 2 AncientBehemoth (ATT:19; DEF:19; THP:569; LDMG:0) +--- Attacker before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) +--- Defender before - 2 AncientBehemoth (ATT:19; DEF:19; THP:569; LDMG:0) +--- Attacker after - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:542.5) +--- Defender after - 1 AncientBehemoth (ATT:19; DEF:19; THP:27; LDMG:0) +--- Attacker before - 1 AncientBehemoth (ATT:19; DEF:19; THP:27; LDMG:0) +--- Defender before - 15 Griffin (ATT:8; DEF:8; THP:368; LDMG:0) +--- Attacker after - 1 AncientBehemoth (ATT:19; DEF:19; THP:27; LDMG:70) +--- Defender after - 12 Griffin (ATT:8; DEF:4; THP:298; LDMG:0) +--- Attacker before - 12 Griffin (ATT:8; DEF:8; THP:298; LDMG:0) +--- Defender before - 1 AncientBehemoth (ATT:19; DEF:19; THP:27; LDMG:0) +--- Attacker after - 12 Griffin (ATT:8; DEF:8; THP:298; LDMG:39.15) +--- Defender after - 0 AncientBehemoth (ATT:19; DEF:19; THP:0; LDMG:0) diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.in.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.in.txt similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.in.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.in.txt index 4639b15..cb66676 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.in.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.in.txt @@ -1,18 +1,18 @@ -add 11 Angel(1) -add 11 Devil(1) -add 11 Archangel(2) -add 11 ArchDevil(3) -attack Archangel(2) Devil(1) -attack ArchDevil(3) Angel(1) -attack Angel(1) ArchDevil(3) -attack Devil(1) Archangel(2) -attack Archangel(2) Devil(1) -attack ArchDevil(3) Angel(1) -attack Archangel(2) ArchDevil(3) -attack ArchDevil(3) Archangel(2) -attack Archangel(2) ArchDevil(3) -attack ArchDevil(3) Archangel(2) -attack Archangel(2) ArchDevil(3) -attack ArchDevil(3) Archangel(2) -attack Archangel(2) ArchDevil(3) -exit +add 11 Angel(1) +add 11 Devil(1) +add 11 Archangel(2) +add 11 ArchDevil(3) +attack Archangel(2) Devil(1) +attack ArchDevil(3) Angel(1) +attack Angel(1) ArchDevil(3) +attack Devil(1) Archangel(2) +attack Archangel(2) Devil(1) +attack ArchDevil(3) Angel(1) +attack Archangel(2) ArchDevil(3) +attack ArchDevil(3) Archangel(2) +attack Archangel(2) ArchDevil(3) +attack ArchDevil(3) Archangel(2) +attack Archangel(2) ArchDevil(3) +attack ArchDevil(3) Archangel(2) +attack Archangel(2) ArchDevil(3) +exit diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.out.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.out.txt similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.out.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.out.txt index 6ca8c67..34e4b0e 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.out.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.out.txt @@ -1,56 +1,56 @@ ---- Creature added to army 1 - Angel (ATT:20; DEF:20; HP:200; DMG:50) [Hate(Devil),Hate(ArchDevil)] ---- Creature added to army 1 - Devil (ATT:19; DEF:26; HP:160; DMG:35) [Hate(Angel),Hate(Archangel),ReduceEnemyDefenseByPercentage(100)] ---- Creature added to army 2 - Archangel (ATT:30; DEF:30; HP:250; DMG:50) [Hate(Devil),Hate(ArchDevil),Resurrection] ---- Creature added to army 3 - ArchDevil (ATT:21; DEF:28; HP:200; DMG:35) [Hate(Angel),Hate(Archangel),ReduceEnemyDefenseByPercentage(100)] ---- Attacker before - 11 Archangel (ATT:30; DEF:30; THP:2750; LDMG:0) ---- Defender before - 11 Devil (ATT:19; DEF:26; THP:1760; LDMG:0) ---- Attacker after - 11 Archangel (ATT:30; DEF:30; THP:2750; LDMG:990) ---- Defender after - 5 Devil (ATT:19; DEF:26; THP:770; LDMG:0) ---- Attacker before - 11 ArchDevil (ATT:21; DEF:28; THP:2200; LDMG:0) ---- Defender before - 11 Angel (ATT:20; DEF:20; THP:2200; LDMG:0) ---- Attacker after - 11 ArchDevil (ATT:21; DEF:28; THP:2200; LDMG:1183.875) ---- Defender after - 6 Angel (ATT:20; DEF:0; THP:1017; LDMG:0) ---- Attacker before - 6 Angel (ATT:20; DEF:20; THP:1017; LDMG:0) ---- Defender before - 11 ArchDevil (ATT:21; DEF:28; THP:2200; LDMG:0) ---- Attacker after - 6 Angel (ATT:20; DEF:20; THP:1017; LDMG:360) ---- Defender after - 10 ArchDevil (ATT:21; DEF:28; THP:1840; LDMG:0) ---- Attacker before - 5 Devil (ATT:19; DEF:26; THP:770; LDMG:0) ---- Defender before - 11 Archangel (ATT:30; DEF:30; THP:2750; LDMG:0) ---- Attacker after - 5 Devil (ATT:19; DEF:26; THP:770; LDMG:511.875) ---- Defender after - 9 Archangel (ATT:30; DEF:0; THP:2250; LDMG:0) ---- Attacker before - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:0) ---- Defender before - 5 Devil (ATT:19; DEF:26; THP:770; LDMG:0) ---- Attacker after - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:810) ---- Defender after - 0 Devil (ATT:19; DEF:26; THP:0; LDMG:0) ---- Attacker before - 10 ArchDevil (ATT:21; DEF:28; THP:1840; LDMG:0) ---- Defender before - 6 Angel (ATT:20; DEF:20; THP:1017; LDMG:0) ---- Attacker after - 10 ArchDevil (ATT:21; DEF:28; THP:1840; LDMG:1076.25) ---- Defender after - 0 Angel (ATT:20; DEF:0; THP:0; LDMG:0) ---- Attacker before - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:0) ---- Defender before - 10 ArchDevil (ATT:21; DEF:28; THP:1840; LDMG:0) ---- Attacker after - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:742.5) ---- Defender after - 6 ArchDevil (ATT:21; DEF:28; THP:1098; LDMG:0) ---- Attacker before - 6 ArchDevil (ATT:21; DEF:28; THP:1098; LDMG:0) ---- Defender before - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:0) ---- Attacker after - 6 ArchDevil (ATT:21; DEF:28; THP:1098; LDMG:645.75) ---- Defender after - 7 Archangel (ATT:30; DEF:0; THP:1750; LDMG:0) ---- Attacker before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) ---- Defender before - 6 ArchDevil (ATT:21; DEF:28; THP:1098; LDMG:0) ---- Attacker after - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:577.5) ---- Defender after - 3 ArchDevil (ATT:21; DEF:28; THP:521; LDMG:0) ---- Attacker before - 3 ArchDevil (ATT:21; DEF:28; THP:521; LDMG:0) ---- Defender before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) ---- Attacker after - 3 ArchDevil (ATT:21; DEF:28; THP:521; LDMG:322.875) ---- Defender after - 6 Archangel (ATT:30; DEF:0; THP:1500; LDMG:0) ---- Attacker before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) ---- Defender before - 3 ArchDevil (ATT:21; DEF:28; THP:521; LDMG:0) ---- Attacker after - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:495) ---- Defender after - 1 ArchDevil (ATT:21; DEF:28; THP:26; LDMG:0) ---- Attacker before - 1 ArchDevil (ATT:21; DEF:28; THP:26; LDMG:0) ---- Defender before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) ---- Attacker after - 1 ArchDevil (ATT:21; DEF:28; THP:26; LDMG:107.625) ---- Defender after - 6 Archangel (ATT:30; DEF:0; THP:1500; LDMG:0) ---- Attacker before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) ---- Defender before - 1 ArchDevil (ATT:21; DEF:28; THP:26; LDMG:0) ---- Attacker after - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:495) ---- Defender after - 0 ArchDevil (ATT:21; DEF:28; THP:0; LDMG:0) +--- Creature added to army 1 - Angel (ATT:20; DEF:20; HP:200; DMG:50) [Hate(Devil),Hate(ArchDevil)] +--- Creature added to army 1 - Devil (ATT:19; DEF:26; HP:160; DMG:35) [Hate(Angel),Hate(Archangel),ReduceEnemyDefenseByPercentage(100)] +--- Creature added to army 2 - Archangel (ATT:30; DEF:30; HP:250; DMG:50) [Hate(Devil),Hate(ArchDevil),Resurrection] +--- Creature added to army 3 - ArchDevil (ATT:21; DEF:28; HP:200; DMG:35) [Hate(Angel),Hate(Archangel),ReduceEnemyDefenseByPercentage(100)] +--- Attacker before - 11 Archangel (ATT:30; DEF:30; THP:2750; LDMG:0) +--- Defender before - 11 Devil (ATT:19; DEF:26; THP:1760; LDMG:0) +--- Attacker after - 11 Archangel (ATT:30; DEF:30; THP:2750; LDMG:990) +--- Defender after - 5 Devil (ATT:19; DEF:26; THP:770; LDMG:0) +--- Attacker before - 11 ArchDevil (ATT:21; DEF:28; THP:2200; LDMG:0) +--- Defender before - 11 Angel (ATT:20; DEF:20; THP:2200; LDMG:0) +--- Attacker after - 11 ArchDevil (ATT:21; DEF:28; THP:2200; LDMG:1183.875) +--- Defender after - 6 Angel (ATT:20; DEF:0; THP:1017; LDMG:0) +--- Attacker before - 6 Angel (ATT:20; DEF:20; THP:1017; LDMG:0) +--- Defender before - 11 ArchDevil (ATT:21; DEF:28; THP:2200; LDMG:0) +--- Attacker after - 6 Angel (ATT:20; DEF:20; THP:1017; LDMG:360) +--- Defender after - 10 ArchDevil (ATT:21; DEF:28; THP:1840; LDMG:0) +--- Attacker before - 5 Devil (ATT:19; DEF:26; THP:770; LDMG:0) +--- Defender before - 11 Archangel (ATT:30; DEF:30; THP:2750; LDMG:0) +--- Attacker after - 5 Devil (ATT:19; DEF:26; THP:770; LDMG:511.875) +--- Defender after - 9 Archangel (ATT:30; DEF:0; THP:2250; LDMG:0) +--- Attacker before - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:0) +--- Defender before - 5 Devil (ATT:19; DEF:26; THP:770; LDMG:0) +--- Attacker after - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:810) +--- Defender after - 0 Devil (ATT:19; DEF:26; THP:0; LDMG:0) +--- Attacker before - 10 ArchDevil (ATT:21; DEF:28; THP:1840; LDMG:0) +--- Defender before - 6 Angel (ATT:20; DEF:20; THP:1017; LDMG:0) +--- Attacker after - 10 ArchDevil (ATT:21; DEF:28; THP:1840; LDMG:1076.25) +--- Defender after - 0 Angel (ATT:20; DEF:0; THP:0; LDMG:0) +--- Attacker before - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:0) +--- Defender before - 10 ArchDevil (ATT:21; DEF:28; THP:1840; LDMG:0) +--- Attacker after - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:742.5) +--- Defender after - 6 ArchDevil (ATT:21; DEF:28; THP:1098; LDMG:0) +--- Attacker before - 6 ArchDevil (ATT:21; DEF:28; THP:1098; LDMG:0) +--- Defender before - 9 Archangel (ATT:30; DEF:30; THP:2250; LDMG:0) +--- Attacker after - 6 ArchDevil (ATT:21; DEF:28; THP:1098; LDMG:645.75) +--- Defender after - 7 Archangel (ATT:30; DEF:0; THP:1750; LDMG:0) +--- Attacker before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) +--- Defender before - 6 ArchDevil (ATT:21; DEF:28; THP:1098; LDMG:0) +--- Attacker after - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:577.5) +--- Defender after - 3 ArchDevil (ATT:21; DEF:28; THP:521; LDMG:0) +--- Attacker before - 3 ArchDevil (ATT:21; DEF:28; THP:521; LDMG:0) +--- Defender before - 7 Archangel (ATT:30; DEF:30; THP:1750; LDMG:0) +--- Attacker after - 3 ArchDevil (ATT:21; DEF:28; THP:521; LDMG:322.875) +--- Defender after - 6 Archangel (ATT:30; DEF:0; THP:1500; LDMG:0) +--- Attacker before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) +--- Defender before - 3 ArchDevil (ATT:21; DEF:28; THP:521; LDMG:0) +--- Attacker after - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:495) +--- Defender after - 1 ArchDevil (ATT:21; DEF:28; THP:26; LDMG:0) +--- Attacker before - 1 ArchDevil (ATT:21; DEF:28; THP:26; LDMG:0) +--- Defender before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) +--- Attacker after - 1 ArchDevil (ATT:21; DEF:28; THP:26; LDMG:107.625) +--- Defender after - 6 Archangel (ATT:30; DEF:0; THP:1500; LDMG:0) +--- Attacker before - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:0) +--- Defender before - 1 ArchDevil (ATT:21; DEF:28; THP:26; LDMG:0) +--- Attacker after - 6 Archangel (ATT:30; DEF:30; THP:1500; LDMG:495) +--- Defender after - 0 ArchDevil (ATT:21; DEF:28; THP:0; LDMG:0) diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.in.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.in.txt similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.in.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.in.txt index 6e2b3f6..aa6badc 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.in.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.in.txt @@ -1,22 +1,22 @@ -add 100 AncientBehemoth(1) -add 1000 CyclopsKing(2) -add 9000 WolfRaider(3) -add 20000 Goblin(3) -add 5000 Griffin(3) -attack AncientBehemoth(1) WolfRaider(3) -attack CyclopsKing(2) Goblin(3) -skip Griffin(3) -attack WolfRaider(3) CyclopsKing(2) -attack Goblin(3) CyclopsKing(2) -attack AncientBehemoth(1) WolfRaider(3) -attack CyclopsKing(2) WolfRaider(3) -attack Griffin(3) CyclopsKing(2) -attack WolfRaider(3) AncientBehemoth(1) -attack Goblin(3) AncientBehemoth(1) -attack AncientBehemoth(1) WolfRaider(3) -attack Griffin(3) AncientBehemoth(1) -skip WolfRaider(3) -attack AncientBehemoth(1) WolfRaider(3) -attack Griffin(3) AncientBehemoth(1) -attack WolfRaider(3) AncientBehemoth(1) -exit +add 100 AncientBehemoth(1) +add 1000 CyclopsKing(2) +add 9000 WolfRaider(3) +add 20000 Goblin(3) +add 5000 Griffin(3) +attack AncientBehemoth(1) WolfRaider(3) +attack CyclopsKing(2) Goblin(3) +skip Griffin(3) +attack WolfRaider(3) CyclopsKing(2) +attack Goblin(3) CyclopsKing(2) +attack AncientBehemoth(1) WolfRaider(3) +attack CyclopsKing(2) WolfRaider(3) +attack Griffin(3) CyclopsKing(2) +attack WolfRaider(3) AncientBehemoth(1) +attack Goblin(3) AncientBehemoth(1) +attack AncientBehemoth(1) WolfRaider(3) +attack Griffin(3) AncientBehemoth(1) +skip WolfRaider(3) +attack AncientBehemoth(1) WolfRaider(3) +attack Griffin(3) AncientBehemoth(1) +attack WolfRaider(3) AncientBehemoth(1) +exit diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.out.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.out.txt similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.out.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.out.txt index b56910f..e76cad1 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.out.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.out.txt @@ -1,65 +1,65 @@ ---- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] ---- Creature added to army 2 - CyclopsKing (ATT:17; DEF:13; HP:70; DMG:18) [AddAttackWhenSkip(3),DoubleAttackWhenAttacking(4),DoubleDamage(1)] ---- Creature added to army 3 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] ---- Creature added to army 3 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] ---- Creature added to army 3 - Griffin (ATT:8; DEF:8; HP:25; DMG:4.5) [DoubleDefenseWhenDefending(5),AddDefenseWhenSkip(3),Hate(WolfRaider)] ---- Attacker before - 100 AncientBehemoth (ATT:19; DEF:19; THP:30000; LDMG:0) ---- Defender before - 9000 WolfRaider (ATT:8; DEF:5; THP:90000; LDMG:0) ---- Attacker after - 100 AncientBehemoth (ATT:19; DEF:19; THP:30000; LDMG:7600) ---- Defender after - 8240 WolfRaider (ATT:8; DEF:1; THP:82400; LDMG:0) ---- Attacker before - 1000 CyclopsKing (ATT:17; DEF:13; THP:70000; LDMG:0) ---- Defender before - 20000 Goblin (ATT:4; DEF:2; THP:100000; LDMG:0) ---- Attacker after - 1000 CyclopsKing (ATT:34; DEF:13; THP:70000; LDMG:93600) ---- Defender after - 1280 Goblin (ATT:4; DEF:2; THP:6400; LDMG:0) ---- Before skip - 5000 Griffin (ATT:8; DEF:8; THP:125000; LDMG:0) ---- After skip - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:0) ---- Attacker before - 8240 WolfRaider (ATT:8; DEF:5; THP:82400; LDMG:0) ---- Defender before - 1000 CyclopsKing (ATT:17; DEF:13; THP:70000; LDMG:0) ---- Attacker after - 8240 WolfRaider (ATT:8; DEF:5; THP:82400; LDMG:50470) ---- Defender after - 279 CyclopsKing (ATT:17; DEF:13; THP:19530; LDMG:0) ---- Attacker before - 1280 Goblin (ATT:4; DEF:2; THP:6400; LDMG:0) ---- Defender before - 279 CyclopsKing (ATT:17; DEF:13; THP:19530; LDMG:0) ---- Attacker after - 1280 Goblin (ATT:4; DEF:2; THP:6400; LDMG:1488) ---- Defender after - 258 CyclopsKing (ATT:17; DEF:13; THP:18042; LDMG:0) ---- Attacker before - 100 AncientBehemoth (ATT:19; DEF:19; THP:30000; LDMG:0) ---- Defender before - 8240 WolfRaider (ATT:8; DEF:5; THP:82400; LDMG:0) ---- Attacker after - 100 AncientBehemoth (ATT:19; DEF:19; THP:30000; LDMG:7600) ---- Defender after - 7480 WolfRaider (ATT:8; DEF:1; THP:74800; LDMG:0) ---- Attacker before - 258 CyclopsKing (ATT:17; DEF:13; THP:18042; LDMG:0) ---- Defender before - 7480 WolfRaider (ATT:8; DEF:5; THP:74800; LDMG:0) ---- Attacker after - 258 CyclopsKing (ATT:34; DEF:13; THP:18042; LDMG:11377.8) ---- Defender after - 6343 WolfRaider (ATT:8; DEF:5; THP:63423; LDMG:0) ---- Attacker before - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:0) ---- Defender before - 258 CyclopsKing (ATT:17; DEF:13; THP:18042; LDMG:0) ---- Attacker after - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:19687.5) ---- Defender after - 0 CyclopsKing (ATT:17; DEF:13; THP:0; LDMG:0) ---- Attacker before - 6343 WolfRaider (ATT:8; DEF:5; THP:63423; LDMG:0) ---- Defender before - 100 AncientBehemoth (ATT:19; DEF:19; THP:30000; LDMG:0) ---- Attacker after - 6343 WolfRaider (ATT:8; DEF:5; THP:63423; LDMG:13320.3) ---- Defender after - 56 AncientBehemoth (ATT:19; DEF:38; THP:16680; LDMG:0) ---- Attacker before - 1280 Goblin (ATT:4; DEF:2; THP:6400; LDMG:0) ---- Defender before - 56 AncientBehemoth (ATT:19; DEF:19; THP:16680; LDMG:0) ---- Attacker after - 1280 Goblin (ATT:4; DEF:2; THP:6400; LDMG:576) ---- Defender after - 54 AncientBehemoth (ATT:19; DEF:38; THP:16104; LDMG:0) ---- Attacker before - 54 AncientBehemoth (ATT:19; DEF:19; THP:16104; LDMG:0) ---- Defender before - 6343 WolfRaider (ATT:8; DEF:5; THP:63423; LDMG:0) ---- Attacker after - 54 AncientBehemoth (ATT:19; DEF:19; THP:16104; LDMG:4104) ---- Defender after - 5932 WolfRaider (ATT:8; DEF:1; THP:59319; LDMG:0) ---- Attacker before - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:0) ---- Defender before - 54 AncientBehemoth (ATT:19; DEF:19; THP:16104; LDMG:0) ---- Attacker after - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:6750) ---- Defender after - 32 AncientBehemoth (ATT:19; DEF:38; THP:9354; LDMG:0) ---- Before skip - 5932 WolfRaider (ATT:8; DEF:5; THP:59319; LDMG:0) ---- After skip - 5932 WolfRaider (ATT:8; DEF:8; THP:59319; LDMG:0) ---- Attacker before - 32 AncientBehemoth (ATT:19; DEF:19; THP:9354; LDMG:0) ---- Defender before - 5932 WolfRaider (ATT:8; DEF:8; THP:59319; LDMG:0) ---- Attacker after - 32 AncientBehemoth (ATT:19; DEF:19; THP:9354; LDMG:2368) ---- Defender after - 5696 WolfRaider (ATT:8; DEF:2; THP:56951; LDMG:0) ---- Attacker before - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:0) ---- Defender before - 32 AncientBehemoth (ATT:19; DEF:19; THP:9354; LDMG:0) ---- Attacker after - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:6750) ---- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2604; LDMG:0) ---- Attacker before - 5696 WolfRaider (ATT:8; DEF:8; THP:56951; LDMG:0) ---- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2604; LDMG:0) ---- Attacker after - 5696 WolfRaider (ATT:8; DEF:8; THP:56951; LDMG:11961.6) ---- Defender after - 0 AncientBehemoth (ATT:19; DEF:38; THP:0; LDMG:0) +--- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] +--- Creature added to army 2 - CyclopsKing (ATT:17; DEF:13; HP:70; DMG:18) [AddAttackWhenSkip(3),DoubleAttackWhenAttacking(4),DoubleDamage(1)] +--- Creature added to army 3 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] +--- Creature added to army 3 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] +--- Creature added to army 3 - Griffin (ATT:8; DEF:8; HP:25; DMG:4.5) [DoubleDefenseWhenDefending(5),AddDefenseWhenSkip(3),Hate(WolfRaider)] +--- Attacker before - 100 AncientBehemoth (ATT:19; DEF:19; THP:30000; LDMG:0) +--- Defender before - 9000 WolfRaider (ATT:8; DEF:5; THP:90000; LDMG:0) +--- Attacker after - 100 AncientBehemoth (ATT:19; DEF:19; THP:30000; LDMG:7600) +--- Defender after - 8240 WolfRaider (ATT:8; DEF:1; THP:82400; LDMG:0) +--- Attacker before - 1000 CyclopsKing (ATT:17; DEF:13; THP:70000; LDMG:0) +--- Defender before - 20000 Goblin (ATT:4; DEF:2; THP:100000; LDMG:0) +--- Attacker after - 1000 CyclopsKing (ATT:34; DEF:13; THP:70000; LDMG:93600) +--- Defender after - 1280 Goblin (ATT:4; DEF:2; THP:6400; LDMG:0) +--- Before skip - 5000 Griffin (ATT:8; DEF:8; THP:125000; LDMG:0) +--- After skip - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:0) +--- Attacker before - 8240 WolfRaider (ATT:8; DEF:5; THP:82400; LDMG:0) +--- Defender before - 1000 CyclopsKing (ATT:17; DEF:13; THP:70000; LDMG:0) +--- Attacker after - 8240 WolfRaider (ATT:8; DEF:5; THP:82400; LDMG:50470) +--- Defender after - 279 CyclopsKing (ATT:17; DEF:13; THP:19530; LDMG:0) +--- Attacker before - 1280 Goblin (ATT:4; DEF:2; THP:6400; LDMG:0) +--- Defender before - 279 CyclopsKing (ATT:17; DEF:13; THP:19530; LDMG:0) +--- Attacker after - 1280 Goblin (ATT:4; DEF:2; THP:6400; LDMG:1488) +--- Defender after - 258 CyclopsKing (ATT:17; DEF:13; THP:18042; LDMG:0) +--- Attacker before - 100 AncientBehemoth (ATT:19; DEF:19; THP:30000; LDMG:0) +--- Defender before - 8240 WolfRaider (ATT:8; DEF:5; THP:82400; LDMG:0) +--- Attacker after - 100 AncientBehemoth (ATT:19; DEF:19; THP:30000; LDMG:7600) +--- Defender after - 7480 WolfRaider (ATT:8; DEF:1; THP:74800; LDMG:0) +--- Attacker before - 258 CyclopsKing (ATT:17; DEF:13; THP:18042; LDMG:0) +--- Defender before - 7480 WolfRaider (ATT:8; DEF:5; THP:74800; LDMG:0) +--- Attacker after - 258 CyclopsKing (ATT:34; DEF:13; THP:18042; LDMG:11377.8) +--- Defender after - 6343 WolfRaider (ATT:8; DEF:5; THP:63423; LDMG:0) +--- Attacker before - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:0) +--- Defender before - 258 CyclopsKing (ATT:17; DEF:13; THP:18042; LDMG:0) +--- Attacker after - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:19687.5) +--- Defender after - 0 CyclopsKing (ATT:17; DEF:13; THP:0; LDMG:0) +--- Attacker before - 6343 WolfRaider (ATT:8; DEF:5; THP:63423; LDMG:0) +--- Defender before - 100 AncientBehemoth (ATT:19; DEF:19; THP:30000; LDMG:0) +--- Attacker after - 6343 WolfRaider (ATT:8; DEF:5; THP:63423; LDMG:13320.3) +--- Defender after - 56 AncientBehemoth (ATT:19; DEF:38; THP:16680; LDMG:0) +--- Attacker before - 1280 Goblin (ATT:4; DEF:2; THP:6400; LDMG:0) +--- Defender before - 56 AncientBehemoth (ATT:19; DEF:19; THP:16680; LDMG:0) +--- Attacker after - 1280 Goblin (ATT:4; DEF:2; THP:6400; LDMG:576) +--- Defender after - 54 AncientBehemoth (ATT:19; DEF:38; THP:16104; LDMG:0) +--- Attacker before - 54 AncientBehemoth (ATT:19; DEF:19; THP:16104; LDMG:0) +--- Defender before - 6343 WolfRaider (ATT:8; DEF:5; THP:63423; LDMG:0) +--- Attacker after - 54 AncientBehemoth (ATT:19; DEF:19; THP:16104; LDMG:4104) +--- Defender after - 5932 WolfRaider (ATT:8; DEF:1; THP:59319; LDMG:0) +--- Attacker before - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:0) +--- Defender before - 54 AncientBehemoth (ATT:19; DEF:19; THP:16104; LDMG:0) +--- Attacker after - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:6750) +--- Defender after - 32 AncientBehemoth (ATT:19; DEF:38; THP:9354; LDMG:0) +--- Before skip - 5932 WolfRaider (ATT:8; DEF:5; THP:59319; LDMG:0) +--- After skip - 5932 WolfRaider (ATT:8; DEF:8; THP:59319; LDMG:0) +--- Attacker before - 32 AncientBehemoth (ATT:19; DEF:19; THP:9354; LDMG:0) +--- Defender before - 5932 WolfRaider (ATT:8; DEF:8; THP:59319; LDMG:0) +--- Attacker after - 32 AncientBehemoth (ATT:19; DEF:19; THP:9354; LDMG:2368) +--- Defender after - 5696 WolfRaider (ATT:8; DEF:2; THP:56951; LDMG:0) +--- Attacker before - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:0) +--- Defender before - 32 AncientBehemoth (ATT:19; DEF:19; THP:9354; LDMG:0) +--- Attacker after - 5000 Griffin (ATT:8; DEF:14; THP:125000; LDMG:6750) +--- Defender after - 9 AncientBehemoth (ATT:19; DEF:38; THP:2604; LDMG:0) +--- Attacker before - 5696 WolfRaider (ATT:8; DEF:8; THP:56951; LDMG:0) +--- Defender before - 9 AncientBehemoth (ATT:19; DEF:19; THP:2604; LDMG:0) +--- Attacker after - 5696 WolfRaider (ATT:8; DEF:8; THP:56951; LDMG:11961.6) +--- Defender after - 0 AncientBehemoth (ATT:19; DEF:38; THP:0; LDMG:0) diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.in.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.in.txt similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.in.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.in.txt index bbb2f1c..f04ea47 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.in.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.in.txt @@ -1,51 +1,51 @@ -add 1000 AncientBehemoth(1) -add 2000 CyclopsKing(2) -add 30000 WolfRaider(3) -add 50000 Goblin(3) -add 10000 Griffin(3) -skip AncientBehemoth(1) -skip CyclopsKing(2) -skip WolfRaider(3) -skip Goblin(3) -skip Griffin(3) -attack AncientBehemoth(1) WolfRaider(3) -attack CyclopsKing(2) WolfRaider(3) -attack WolfRaider(3) CyclopsKing(2) -attack Goblin(3) CyclopsKing(2) -attack Griffin(3) CyclopsKing(2) -attack AncientBehemoth(1) WolfRaider(3) -attack CyclopsKing(2) Goblin(3) -attack Goblin(3) AncientBehemoth(1) -attack Griffin(3) AncientBehemoth(1) -attack AncientBehemoth(1) Griffin(3) -attack CyclopsKing(2) Griffin(3) -attack Goblin(3) AncientBehemoth(1) -attack Griffin(3) AncientBehemoth(1) -attack AncientBehemoth(1) Griffin(3) -attack CyclopsKing(2) Griffin(3) -attack Goblin(3) AncientBehemoth(1) -attack Griffin(3) AncientBehemoth(1) -attack AncientBehemoth(1) Griffin(3) -attack CyclopsKing(2) Griffin(3) -attack Goblin(3) AncientBehemoth(1) -attack Griffin(3) AncientBehemoth(1) -attack AncientBehemoth(1) Griffin(3) -attack CyclopsKing(2) Griffin(3) -attack Goblin(3) AncientBehemoth(1) -attack Griffin(3) AncientBehemoth(1) -attack AncientBehemoth(1) Griffin(3) -attack CyclopsKing(2) Goblin(3) -attack Goblin(3) AncientBehemoth(1) -attack AncientBehemoth(1) Goblin(3) -attack CyclopsKing(2) Goblin(3) -attack Goblin(3) AncientBehemoth(1) -attack AncientBehemoth(1) Goblin(3) -attack CyclopsKing(2) Goblin(3) -attack Goblin(3) AncientBehemoth(1) -attack AncientBehemoth(1) Goblin(3) -attack CyclopsKing(2) Goblin(3) -attack Goblin(3) AncientBehemoth(1) -attack AncientBehemoth(1) Goblin(3) -attack CyclopsKing(2) Goblin(3) -attack Goblin(3) AncientBehemoth(1) -exit +add 1000 AncientBehemoth(1) +add 2000 CyclopsKing(2) +add 30000 WolfRaider(3) +add 50000 Goblin(3) +add 10000 Griffin(3) +skip AncientBehemoth(1) +skip CyclopsKing(2) +skip WolfRaider(3) +skip Goblin(3) +skip Griffin(3) +attack AncientBehemoth(1) WolfRaider(3) +attack CyclopsKing(2) WolfRaider(3) +attack WolfRaider(3) CyclopsKing(2) +attack Goblin(3) CyclopsKing(2) +attack Griffin(3) CyclopsKing(2) +attack AncientBehemoth(1) WolfRaider(3) +attack CyclopsKing(2) Goblin(3) +attack Goblin(3) AncientBehemoth(1) +attack Griffin(3) AncientBehemoth(1) +attack AncientBehemoth(1) Griffin(3) +attack CyclopsKing(2) Griffin(3) +attack Goblin(3) AncientBehemoth(1) +attack Griffin(3) AncientBehemoth(1) +attack AncientBehemoth(1) Griffin(3) +attack CyclopsKing(2) Griffin(3) +attack Goblin(3) AncientBehemoth(1) +attack Griffin(3) AncientBehemoth(1) +attack AncientBehemoth(1) Griffin(3) +attack CyclopsKing(2) Griffin(3) +attack Goblin(3) AncientBehemoth(1) +attack Griffin(3) AncientBehemoth(1) +attack AncientBehemoth(1) Griffin(3) +attack CyclopsKing(2) Griffin(3) +attack Goblin(3) AncientBehemoth(1) +attack Griffin(3) AncientBehemoth(1) +attack AncientBehemoth(1) Griffin(3) +attack CyclopsKing(2) Goblin(3) +attack Goblin(3) AncientBehemoth(1) +attack AncientBehemoth(1) Goblin(3) +attack CyclopsKing(2) Goblin(3) +attack Goblin(3) AncientBehemoth(1) +attack AncientBehemoth(1) Goblin(3) +attack CyclopsKing(2) Goblin(3) +attack Goblin(3) AncientBehemoth(1) +attack AncientBehemoth(1) Goblin(3) +attack CyclopsKing(2) Goblin(3) +attack Goblin(3) AncientBehemoth(1) +attack AncientBehemoth(1) Goblin(3) +attack CyclopsKing(2) Goblin(3) +attack Goblin(3) AncientBehemoth(1) +exit diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.out.txt b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.out.txt similarity index 98% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.out.txt rename to Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.out.txt index 58fc25d..eb05542 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.out.txt +++ b/Topics/04. Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.010.out.txt @@ -1,175 +1,175 @@ ---- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] ---- Creature added to army 2 - CyclopsKing (ATT:17; DEF:13; HP:70; DMG:18) [AddAttackWhenSkip(3),DoubleAttackWhenAttacking(4),DoubleDamage(1)] ---- Creature added to army 3 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] ---- Creature added to army 3 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] ---- Creature added to army 3 - Griffin (ATT:8; DEF:8; HP:25; DMG:4.5) [DoubleDefenseWhenDefending(5),AddDefenseWhenSkip(3),Hate(WolfRaider)] ---- Before skip - 1000 AncientBehemoth (ATT:19; DEF:19; THP:300000; LDMG:0) ---- After skip - 1000 AncientBehemoth (ATT:19; DEF:22; THP:300000; LDMG:0) ---- Before skip - 2000 CyclopsKing (ATT:17; DEF:13; THP:140000; LDMG:0) ---- After skip - 2000 CyclopsKing (ATT:20; DEF:16; THP:140000; LDMG:0) ---- Before skip - 30000 WolfRaider (ATT:8; DEF:5; THP:300000; LDMG:0) ---- After skip - 30000 WolfRaider (ATT:8; DEF:8; THP:300000; LDMG:0) ---- Before skip - 50000 Goblin (ATT:4; DEF:2; THP:250000; LDMG:0) ---- After skip - 50000 Goblin (ATT:4; DEF:5; THP:250000; LDMG:0) ---- Before skip - 10000 Griffin (ATT:8; DEF:8; THP:250000; LDMG:0) ---- After skip - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) ---- Attacker before - 1000 AncientBehemoth (ATT:19; DEF:22; THP:300000; LDMG:0) ---- Defender before - 30000 WolfRaider (ATT:8; DEF:8; THP:300000; LDMG:0) ---- Attacker after - 1000 AncientBehemoth (ATT:19; DEF:22; THP:300000; LDMG:74000) ---- Defender after - 22600 WolfRaider (ATT:8; DEF:2; THP:226000; LDMG:0) ---- Attacker before - 2000 CyclopsKing (ATT:20; DEF:16; THP:140000; LDMG:0) ---- Defender before - 22600 WolfRaider (ATT:8; DEF:8; THP:226000; LDMG:0) ---- Attacker after - 2000 CyclopsKing (ATT:40; DEF:16; THP:140000; LDMG:187200) ---- Defender after - 3880 WolfRaider (ATT:8; DEF:8; THP:38800; LDMG:0) ---- Attacker before - 3880 WolfRaider (ATT:8; DEF:8; THP:38800; LDMG:0) ---- Defender before - 2000 CyclopsKing (ATT:20; DEF:16; THP:140000; LDMG:0) ---- Attacker after - 3880 WolfRaider (ATT:8; DEF:8; THP:38800; LDMG:21728) ---- Defender after - 1690 CyclopsKing (ATT:20; DEF:16; THP:118272; LDMG:0) ---- Attacker before - 50000 Goblin (ATT:4; DEF:5; THP:250000; LDMG:0) ---- Defender before - 1690 CyclopsKing (ATT:20; DEF:16; THP:118272; LDMG:0) ---- Attacker after - 50000 Goblin (ATT:4; DEF:5; THP:250000; LDMG:52500) ---- Defender after - 940 CyclopsKing (ATT:20; DEF:16; THP:65772; LDMG:0) ---- Attacker before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) ---- Defender before - 940 CyclopsKing (ATT:20; DEF:16; THP:65772; LDMG:0) ---- Attacker after - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:36000) ---- Defender after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) ---- Attacker before - 1000 AncientBehemoth (ATT:19; DEF:22; THP:300000; LDMG:0) ---- Defender before - 3880 WolfRaider (ATT:8; DEF:8; THP:38800; LDMG:0) ---- Attacker after - 1000 AncientBehemoth (ATT:19; DEF:22; THP:300000; LDMG:74000) ---- Defender after - 0 WolfRaider (ATT:8; DEF:2; THP:0; LDMG:0) ---- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) ---- Defender before - 50000 Goblin (ATT:4; DEF:5; THP:250000; LDMG:0) ---- Attacker after - 426 CyclopsKing (ATT:40; DEF:16; THP:29772; LDMG:21087) ---- Defender after - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) ---- Attacker before - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) ---- Defender before - 1000 AncientBehemoth (ATT:19; DEF:22; THP:300000; LDMG:0) ---- Attacker after - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:20602.35) ---- Defender after - 932 AncientBehemoth (ATT:19; DEF:44; THP:279398; LDMG:0) ---- Attacker before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) ---- Defender before - 932 AncientBehemoth (ATT:19; DEF:22; THP:279398; LDMG:0) ---- Attacker after - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:13500) ---- Defender after - 887 AncientBehemoth (ATT:19; DEF:44; THP:265898; LDMG:0) ---- Attacker before - 887 AncientBehemoth (ATT:19; DEF:22; THP:265898; LDMG:0) ---- Defender before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) ---- Attacker after - 887 AncientBehemoth (ATT:19; DEF:22; THP:265898; LDMG:58542) ---- Defender after - 7659 Griffin (ATT:8; DEF:6; THP:191458; LDMG:0) ---- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) ---- Defender before - 7659 Griffin (ATT:8; DEF:14; THP:191458; LDMG:0) ---- Attacker after - 426 CyclopsKing (ATT:40; DEF:16; THP:29772; LDMG:12268.8) ---- Defender after - 7168 Griffin (ATT:8; DEF:28; THP:179190; LDMG:0) ---- Attacker before - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) ---- Defender before - 887 AncientBehemoth (ATT:19; DEF:22; THP:265898; LDMG:0) ---- Attacker after - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:20602.35) ---- Defender after - 818 AncientBehemoth (ATT:19; DEF:44; THP:245296; LDMG:0) ---- Attacker before - 7168 Griffin (ATT:8; DEF:14; THP:179190; LDMG:0) ---- Defender before - 818 AncientBehemoth (ATT:19; DEF:22; THP:245296; LDMG:0) ---- Attacker after - 7168 Griffin (ATT:8; DEF:14; THP:179190; LDMG:9676.8) ---- Defender after - 786 AncientBehemoth (ATT:19; DEF:44; THP:235620; LDMG:0) ---- Attacker before - 786 AncientBehemoth (ATT:19; DEF:22; THP:235620; LDMG:0) ---- Defender before - 7168 Griffin (ATT:8; DEF:14; THP:179190; LDMG:0) ---- Attacker after - 786 AncientBehemoth (ATT:19; DEF:22; THP:235620; LDMG:51876) ---- Defender after - 5093 Griffin (ATT:8; DEF:6; THP:127314; LDMG:0) ---- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) ---- Defender before - 5093 Griffin (ATT:8; DEF:14; THP:127314; LDMG:0) ---- Attacker after - 426 CyclopsKing (ATT:40; DEF:16; THP:29772; LDMG:12268.8) ---- Defender after - 4602 Griffin (ATT:8; DEF:28; THP:115046; LDMG:0) ---- Attacker before - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) ---- Defender before - 786 AncientBehemoth (ATT:19; DEF:22; THP:235620; LDMG:0) ---- Attacker after - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:20602.35) ---- Defender after - 717 AncientBehemoth (ATT:19; DEF:44; THP:215018; LDMG:0) ---- Attacker before - 4602 Griffin (ATT:8; DEF:14; THP:115046; LDMG:0) ---- Defender before - 717 AncientBehemoth (ATT:19; DEF:22; THP:215018; LDMG:0) ---- Attacker after - 4602 Griffin (ATT:8; DEF:14; THP:115046; LDMG:13460.85) ---- Defender after - 672 AncientBehemoth (ATT:19; DEF:22; THP:201558; LDMG:0) ---- Attacker before - 672 AncientBehemoth (ATT:19; DEF:22; THP:201558; LDMG:0) ---- Defender before - 4602 Griffin (ATT:8; DEF:14; THP:115046; LDMG:0) ---- Attacker after - 672 AncientBehemoth (ATT:19; DEF:22; THP:201558; LDMG:44352) ---- Defender after - 2828 Griffin (ATT:8; DEF:6; THP:70694; LDMG:0) ---- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) ---- Defender before - 2828 Griffin (ATT:8; DEF:14; THP:70694; LDMG:0) ---- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:9968.4) ---- Defender after - 2430 Griffin (ATT:8; DEF:14; THP:60726; LDMG:0) ---- Attacker before - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) ---- Defender before - 672 AncientBehemoth (ATT:19; DEF:22; THP:201558; LDMG:0) ---- Attacker after - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:37770.975) ---- Defender after - 546 AncientBehemoth (ATT:19; DEF:22; THP:163788; LDMG:0) ---- Attacker before - 2430 Griffin (ATT:8; DEF:14; THP:60726; LDMG:0) ---- Defender before - 546 AncientBehemoth (ATT:19; DEF:22; THP:163788; LDMG:0) ---- Attacker after - 2430 Griffin (ATT:8; DEF:14; THP:60726; LDMG:7107.75) ---- Defender after - 523 AncientBehemoth (ATT:19; DEF:22; THP:156681; LDMG:0) ---- Attacker before - 523 AncientBehemoth (ATT:19; DEF:22; THP:156681; LDMG:0) ---- Defender before - 2430 Griffin (ATT:8; DEF:14; THP:60726; LDMG:0) ---- Attacker after - 523 AncientBehemoth (ATT:19; DEF:22; THP:156681; LDMG:37656) ---- Defender after - 923 Griffin (ATT:8; DEF:3; THP:23070; LDMG:0) ---- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) ---- Defender before - 923 Griffin (ATT:8; DEF:14; THP:23070; LDMG:0) ---- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:9968.4) ---- Defender after - 525 Griffin (ATT:8; DEF:14; THP:13102; LDMG:0) ---- Attacker before - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) ---- Defender before - 523 AncientBehemoth (ATT:19; DEF:22; THP:156681; LDMG:0) ---- Attacker after - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:37770.975) ---- Defender after - 397 AncientBehemoth (ATT:19; DEF:22; THP:118911; LDMG:0) ---- Attacker before - 525 Griffin (ATT:8; DEF:14; THP:13102; LDMG:0) ---- Defender before - 397 AncientBehemoth (ATT:19; DEF:22; THP:118911; LDMG:0) ---- Attacker after - 525 Griffin (ATT:8; DEF:14; THP:13102; LDMG:1535.625) ---- Defender after - 392 AncientBehemoth (ATT:19; DEF:22; THP:117376; LDMG:0) ---- Attacker before - 392 AncientBehemoth (ATT:19; DEF:22; THP:117376; LDMG:0) ---- Defender before - 525 Griffin (ATT:8; DEF:14; THP:13102; LDMG:0) ---- Attacker after - 392 AncientBehemoth (ATT:19; DEF:22; THP:117376; LDMG:28224) ---- Defender after - 0 Griffin (ATT:8; DEF:3; THP:0; LDMG:0) ---- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) ---- Defender before - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) ---- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:13419) ---- Defender after - 43099 Goblin (ATT:4; DEF:5; THP:215494; LDMG:0) ---- Attacker before - 43099 Goblin (ATT:4; DEF:5; THP:215494; LDMG:0) ---- Defender before - 392 AncientBehemoth (ATT:19; DEF:22; THP:117376; LDMG:0) ---- Attacker after - 43099 Goblin (ATT:4; DEF:5; THP:215494; LDMG:35556.675) ---- Defender after - 273 AncientBehemoth (ATT:19; DEF:22; THP:81820; LDMG:0) ---- Attacker before - 273 AncientBehemoth (ATT:19; DEF:22; THP:81820; LDMG:0) ---- Defender before - 43099 Goblin (ATT:4; DEF:5; THP:215494; LDMG:0) ---- Attacker after - 273 AncientBehemoth (ATT:19; DEF:22; THP:81820; LDMG:20748) ---- Defender after - 38950 Goblin (ATT:4; DEF:1; THP:194746; LDMG:0) ---- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) ---- Defender before - 38950 Goblin (ATT:4; DEF:5; THP:194746; LDMG:0) ---- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:13419) ---- Defender after - 36266 Goblin (ATT:4; DEF:5; THP:181327; LDMG:0) ---- Attacker before - 36266 Goblin (ATT:4; DEF:5; THP:181327; LDMG:0) ---- Defender before - 273 AncientBehemoth (ATT:19; DEF:22; THP:81820; LDMG:0) ---- Attacker after - 36266 Goblin (ATT:4; DEF:5; THP:181327; LDMG:29919.45) ---- Defender after - 174 AncientBehemoth (ATT:19; DEF:22; THP:51901; LDMG:0) ---- Attacker before - 174 AncientBehemoth (ATT:19; DEF:22; THP:51901; LDMG:0) ---- Defender before - 36266 Goblin (ATT:4; DEF:5; THP:181327; LDMG:0) ---- Attacker after - 174 AncientBehemoth (ATT:19; DEF:22; THP:51901; LDMG:13224) ---- Defender after - 33621 Goblin (ATT:4; DEF:1; THP:168103; LDMG:0) ---- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) ---- Defender before - 33621 Goblin (ATT:4; DEF:5; THP:168103; LDMG:0) ---- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:13419) ---- Defender after - 30937 Goblin (ATT:4; DEF:5; THP:154684; LDMG:0) ---- Attacker before - 30937 Goblin (ATT:4; DEF:5; THP:154684; LDMG:0) ---- Defender before - 174 AncientBehemoth (ATT:19; DEF:22; THP:51901; LDMG:0) ---- Attacker after - 30937 Goblin (ATT:4; DEF:5; THP:154684; LDMG:25523.025) ---- Defender after - 88 AncientBehemoth (ATT:19; DEF:22; THP:26378; LDMG:0) ---- Attacker before - 88 AncientBehemoth (ATT:19; DEF:22; THP:26378; LDMG:0) ---- Defender before - 30937 Goblin (ATT:4; DEF:5; THP:154684; LDMG:0) ---- Attacker after - 88 AncientBehemoth (ATT:19; DEF:22; THP:26378; LDMG:6688) ---- Defender after - 29600 Goblin (ATT:4; DEF:1; THP:147996; LDMG:0) ---- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) ---- Defender before - 29600 Goblin (ATT:4; DEF:5; THP:147996; LDMG:0) ---- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:13419) ---- Defender after - 26916 Goblin (ATT:4; DEF:5; THP:134577; LDMG:0) ---- Attacker before - 26916 Goblin (ATT:4; DEF:5; THP:134577; LDMG:0) ---- Defender before - 88 AncientBehemoth (ATT:19; DEF:22; THP:26378; LDMG:0) ---- Attacker after - 26916 Goblin (ATT:4; DEF:5; THP:134577; LDMG:22205.7) ---- Defender after - 14 AncientBehemoth (ATT:19; DEF:22; THP:4173; LDMG:0) ---- Attacker before - 14 AncientBehemoth (ATT:19; DEF:22; THP:4173; LDMG:0) ---- Defender before - 26916 Goblin (ATT:4; DEF:5; THP:134577; LDMG:0) ---- Attacker after - 14 AncientBehemoth (ATT:19; DEF:22; THP:4173; LDMG:1064) ---- Defender after - 26703 Goblin (ATT:4; DEF:1; THP:133513; LDMG:0) ---- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) ---- Defender before - 26703 Goblin (ATT:4; DEF:5; THP:133513; LDMG:0) ---- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:13419) ---- Defender after - 24019 Goblin (ATT:4; DEF:5; THP:120094; LDMG:0) ---- Attacker before - 24019 Goblin (ATT:4; DEF:5; THP:120094; LDMG:0) ---- Defender before - 14 AncientBehemoth (ATT:19; DEF:22; THP:4173; LDMG:0) ---- Attacker after - 24019 Goblin (ATT:4; DEF:5; THP:120094; LDMG:19815.675) ---- Defender after - 0 AncientBehemoth (ATT:19; DEF:22; THP:0; LDMG:0) +--- Creature added to army 1 - AncientBehemoth (ATT:19; DEF:19; HP:300; DMG:40) [ReduceEnemyDefenseByPercentage(80),DoubleDefenseWhenDefending(5)] +--- Creature added to army 2 - CyclopsKing (ATT:17; DEF:13; HP:70; DMG:18) [AddAttackWhenSkip(3),DoubleAttackWhenAttacking(4),DoubleDamage(1)] +--- Creature added to army 3 - WolfRaider (ATT:8; DEF:5; HP:10; DMG:3.5) [DoubleDamage(7)] +--- Creature added to army 3 - Goblin (ATT:4; DEF:2; HP:5; DMG:1.5) [] +--- Creature added to army 3 - Griffin (ATT:8; DEF:8; HP:25; DMG:4.5) [DoubleDefenseWhenDefending(5),AddDefenseWhenSkip(3),Hate(WolfRaider)] +--- Before skip - 1000 AncientBehemoth (ATT:19; DEF:19; THP:300000; LDMG:0) +--- After skip - 1000 AncientBehemoth (ATT:19; DEF:22; THP:300000; LDMG:0) +--- Before skip - 2000 CyclopsKing (ATT:17; DEF:13; THP:140000; LDMG:0) +--- After skip - 2000 CyclopsKing (ATT:20; DEF:16; THP:140000; LDMG:0) +--- Before skip - 30000 WolfRaider (ATT:8; DEF:5; THP:300000; LDMG:0) +--- After skip - 30000 WolfRaider (ATT:8; DEF:8; THP:300000; LDMG:0) +--- Before skip - 50000 Goblin (ATT:4; DEF:2; THP:250000; LDMG:0) +--- After skip - 50000 Goblin (ATT:4; DEF:5; THP:250000; LDMG:0) +--- Before skip - 10000 Griffin (ATT:8; DEF:8; THP:250000; LDMG:0) +--- After skip - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) +--- Attacker before - 1000 AncientBehemoth (ATT:19; DEF:22; THP:300000; LDMG:0) +--- Defender before - 30000 WolfRaider (ATT:8; DEF:8; THP:300000; LDMG:0) +--- Attacker after - 1000 AncientBehemoth (ATT:19; DEF:22; THP:300000; LDMG:74000) +--- Defender after - 22600 WolfRaider (ATT:8; DEF:2; THP:226000; LDMG:0) +--- Attacker before - 2000 CyclopsKing (ATT:20; DEF:16; THP:140000; LDMG:0) +--- Defender before - 22600 WolfRaider (ATT:8; DEF:8; THP:226000; LDMG:0) +--- Attacker after - 2000 CyclopsKing (ATT:40; DEF:16; THP:140000; LDMG:187200) +--- Defender after - 3880 WolfRaider (ATT:8; DEF:8; THP:38800; LDMG:0) +--- Attacker before - 3880 WolfRaider (ATT:8; DEF:8; THP:38800; LDMG:0) +--- Defender before - 2000 CyclopsKing (ATT:20; DEF:16; THP:140000; LDMG:0) +--- Attacker after - 3880 WolfRaider (ATT:8; DEF:8; THP:38800; LDMG:21728) +--- Defender after - 1690 CyclopsKing (ATT:20; DEF:16; THP:118272; LDMG:0) +--- Attacker before - 50000 Goblin (ATT:4; DEF:5; THP:250000; LDMG:0) +--- Defender before - 1690 CyclopsKing (ATT:20; DEF:16; THP:118272; LDMG:0) +--- Attacker after - 50000 Goblin (ATT:4; DEF:5; THP:250000; LDMG:52500) +--- Defender after - 940 CyclopsKing (ATT:20; DEF:16; THP:65772; LDMG:0) +--- Attacker before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) +--- Defender before - 940 CyclopsKing (ATT:20; DEF:16; THP:65772; LDMG:0) +--- Attacker after - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:36000) +--- Defender after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) +--- Attacker before - 1000 AncientBehemoth (ATT:19; DEF:22; THP:300000; LDMG:0) +--- Defender before - 3880 WolfRaider (ATT:8; DEF:8; THP:38800; LDMG:0) +--- Attacker after - 1000 AncientBehemoth (ATT:19; DEF:22; THP:300000; LDMG:74000) +--- Defender after - 0 WolfRaider (ATT:8; DEF:2; THP:0; LDMG:0) +--- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) +--- Defender before - 50000 Goblin (ATT:4; DEF:5; THP:250000; LDMG:0) +--- Attacker after - 426 CyclopsKing (ATT:40; DEF:16; THP:29772; LDMG:21087) +--- Defender after - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) +--- Attacker before - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) +--- Defender before - 1000 AncientBehemoth (ATT:19; DEF:22; THP:300000; LDMG:0) +--- Attacker after - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:20602.35) +--- Defender after - 932 AncientBehemoth (ATT:19; DEF:44; THP:279398; LDMG:0) +--- Attacker before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) +--- Defender before - 932 AncientBehemoth (ATT:19; DEF:22; THP:279398; LDMG:0) +--- Attacker after - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:13500) +--- Defender after - 887 AncientBehemoth (ATT:19; DEF:44; THP:265898; LDMG:0) +--- Attacker before - 887 AncientBehemoth (ATT:19; DEF:22; THP:265898; LDMG:0) +--- Defender before - 10000 Griffin (ATT:8; DEF:14; THP:250000; LDMG:0) +--- Attacker after - 887 AncientBehemoth (ATT:19; DEF:22; THP:265898; LDMG:58542) +--- Defender after - 7659 Griffin (ATT:8; DEF:6; THP:191458; LDMG:0) +--- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) +--- Defender before - 7659 Griffin (ATT:8; DEF:14; THP:191458; LDMG:0) +--- Attacker after - 426 CyclopsKing (ATT:40; DEF:16; THP:29772; LDMG:12268.8) +--- Defender after - 7168 Griffin (ATT:8; DEF:28; THP:179190; LDMG:0) +--- Attacker before - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) +--- Defender before - 887 AncientBehemoth (ATT:19; DEF:22; THP:265898; LDMG:0) +--- Attacker after - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:20602.35) +--- Defender after - 818 AncientBehemoth (ATT:19; DEF:44; THP:245296; LDMG:0) +--- Attacker before - 7168 Griffin (ATT:8; DEF:14; THP:179190; LDMG:0) +--- Defender before - 818 AncientBehemoth (ATT:19; DEF:22; THP:245296; LDMG:0) +--- Attacker after - 7168 Griffin (ATT:8; DEF:14; THP:179190; LDMG:9676.8) +--- Defender after - 786 AncientBehemoth (ATT:19; DEF:44; THP:235620; LDMG:0) +--- Attacker before - 786 AncientBehemoth (ATT:19; DEF:22; THP:235620; LDMG:0) +--- Defender before - 7168 Griffin (ATT:8; DEF:14; THP:179190; LDMG:0) +--- Attacker after - 786 AncientBehemoth (ATT:19; DEF:22; THP:235620; LDMG:51876) +--- Defender after - 5093 Griffin (ATT:8; DEF:6; THP:127314; LDMG:0) +--- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) +--- Defender before - 5093 Griffin (ATT:8; DEF:14; THP:127314; LDMG:0) +--- Attacker after - 426 CyclopsKing (ATT:40; DEF:16; THP:29772; LDMG:12268.8) +--- Defender after - 4602 Griffin (ATT:8; DEF:28; THP:115046; LDMG:0) +--- Attacker before - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) +--- Defender before - 786 AncientBehemoth (ATT:19; DEF:22; THP:235620; LDMG:0) +--- Attacker after - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:20602.35) +--- Defender after - 717 AncientBehemoth (ATT:19; DEF:44; THP:215018; LDMG:0) +--- Attacker before - 4602 Griffin (ATT:8; DEF:14; THP:115046; LDMG:0) +--- Defender before - 717 AncientBehemoth (ATT:19; DEF:22; THP:215018; LDMG:0) +--- Attacker after - 4602 Griffin (ATT:8; DEF:14; THP:115046; LDMG:13460.85) +--- Defender after - 672 AncientBehemoth (ATT:19; DEF:22; THP:201558; LDMG:0) +--- Attacker before - 672 AncientBehemoth (ATT:19; DEF:22; THP:201558; LDMG:0) +--- Defender before - 4602 Griffin (ATT:8; DEF:14; THP:115046; LDMG:0) +--- Attacker after - 672 AncientBehemoth (ATT:19; DEF:22; THP:201558; LDMG:44352) +--- Defender after - 2828 Griffin (ATT:8; DEF:6; THP:70694; LDMG:0) +--- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) +--- Defender before - 2828 Griffin (ATT:8; DEF:14; THP:70694; LDMG:0) +--- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:9968.4) +--- Defender after - 2430 Griffin (ATT:8; DEF:14; THP:60726; LDMG:0) +--- Attacker before - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) +--- Defender before - 672 AncientBehemoth (ATT:19; DEF:22; THP:201558; LDMG:0) +--- Attacker after - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:37770.975) +--- Defender after - 546 AncientBehemoth (ATT:19; DEF:22; THP:163788; LDMG:0) +--- Attacker before - 2430 Griffin (ATT:8; DEF:14; THP:60726; LDMG:0) +--- Defender before - 546 AncientBehemoth (ATT:19; DEF:22; THP:163788; LDMG:0) +--- Attacker after - 2430 Griffin (ATT:8; DEF:14; THP:60726; LDMG:7107.75) +--- Defender after - 523 AncientBehemoth (ATT:19; DEF:22; THP:156681; LDMG:0) +--- Attacker before - 523 AncientBehemoth (ATT:19; DEF:22; THP:156681; LDMG:0) +--- Defender before - 2430 Griffin (ATT:8; DEF:14; THP:60726; LDMG:0) +--- Attacker after - 523 AncientBehemoth (ATT:19; DEF:22; THP:156681; LDMG:37656) +--- Defender after - 923 Griffin (ATT:8; DEF:3; THP:23070; LDMG:0) +--- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) +--- Defender before - 923 Griffin (ATT:8; DEF:14; THP:23070; LDMG:0) +--- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:9968.4) +--- Defender after - 525 Griffin (ATT:8; DEF:14; THP:13102; LDMG:0) +--- Attacker before - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) +--- Defender before - 523 AncientBehemoth (ATT:19; DEF:22; THP:156681; LDMG:0) +--- Attacker after - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:37770.975) +--- Defender after - 397 AncientBehemoth (ATT:19; DEF:22; THP:118911; LDMG:0) +--- Attacker before - 525 Griffin (ATT:8; DEF:14; THP:13102; LDMG:0) +--- Defender before - 397 AncientBehemoth (ATT:19; DEF:22; THP:118911; LDMG:0) +--- Attacker after - 525 Griffin (ATT:8; DEF:14; THP:13102; LDMG:1535.625) +--- Defender after - 392 AncientBehemoth (ATT:19; DEF:22; THP:117376; LDMG:0) +--- Attacker before - 392 AncientBehemoth (ATT:19; DEF:22; THP:117376; LDMG:0) +--- Defender before - 525 Griffin (ATT:8; DEF:14; THP:13102; LDMG:0) +--- Attacker after - 392 AncientBehemoth (ATT:19; DEF:22; THP:117376; LDMG:28224) +--- Defender after - 0 Griffin (ATT:8; DEF:3; THP:0; LDMG:0) +--- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) +--- Defender before - 45783 Goblin (ATT:4; DEF:5; THP:228913; LDMG:0) +--- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:13419) +--- Defender after - 43099 Goblin (ATT:4; DEF:5; THP:215494; LDMG:0) +--- Attacker before - 43099 Goblin (ATT:4; DEF:5; THP:215494; LDMG:0) +--- Defender before - 392 AncientBehemoth (ATT:19; DEF:22; THP:117376; LDMG:0) +--- Attacker after - 43099 Goblin (ATT:4; DEF:5; THP:215494; LDMG:35556.675) +--- Defender after - 273 AncientBehemoth (ATT:19; DEF:22; THP:81820; LDMG:0) +--- Attacker before - 273 AncientBehemoth (ATT:19; DEF:22; THP:81820; LDMG:0) +--- Defender before - 43099 Goblin (ATT:4; DEF:5; THP:215494; LDMG:0) +--- Attacker after - 273 AncientBehemoth (ATT:19; DEF:22; THP:81820; LDMG:20748) +--- Defender after - 38950 Goblin (ATT:4; DEF:1; THP:194746; LDMG:0) +--- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) +--- Defender before - 38950 Goblin (ATT:4; DEF:5; THP:194746; LDMG:0) +--- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:13419) +--- Defender after - 36266 Goblin (ATT:4; DEF:5; THP:181327; LDMG:0) +--- Attacker before - 36266 Goblin (ATT:4; DEF:5; THP:181327; LDMG:0) +--- Defender before - 273 AncientBehemoth (ATT:19; DEF:22; THP:81820; LDMG:0) +--- Attacker after - 36266 Goblin (ATT:4; DEF:5; THP:181327; LDMG:29919.45) +--- Defender after - 174 AncientBehemoth (ATT:19; DEF:22; THP:51901; LDMG:0) +--- Attacker before - 174 AncientBehemoth (ATT:19; DEF:22; THP:51901; LDMG:0) +--- Defender before - 36266 Goblin (ATT:4; DEF:5; THP:181327; LDMG:0) +--- Attacker after - 174 AncientBehemoth (ATT:19; DEF:22; THP:51901; LDMG:13224) +--- Defender after - 33621 Goblin (ATT:4; DEF:1; THP:168103; LDMG:0) +--- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) +--- Defender before - 33621 Goblin (ATT:4; DEF:5; THP:168103; LDMG:0) +--- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:13419) +--- Defender after - 30937 Goblin (ATT:4; DEF:5; THP:154684; LDMG:0) +--- Attacker before - 30937 Goblin (ATT:4; DEF:5; THP:154684; LDMG:0) +--- Defender before - 174 AncientBehemoth (ATT:19; DEF:22; THP:51901; LDMG:0) +--- Attacker after - 30937 Goblin (ATT:4; DEF:5; THP:154684; LDMG:25523.025) +--- Defender after - 88 AncientBehemoth (ATT:19; DEF:22; THP:26378; LDMG:0) +--- Attacker before - 88 AncientBehemoth (ATT:19; DEF:22; THP:26378; LDMG:0) +--- Defender before - 30937 Goblin (ATT:4; DEF:5; THP:154684; LDMG:0) +--- Attacker after - 88 AncientBehemoth (ATT:19; DEF:22; THP:26378; LDMG:6688) +--- Defender after - 29600 Goblin (ATT:4; DEF:1; THP:147996; LDMG:0) +--- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) +--- Defender before - 29600 Goblin (ATT:4; DEF:5; THP:147996; LDMG:0) +--- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:13419) +--- Defender after - 26916 Goblin (ATT:4; DEF:5; THP:134577; LDMG:0) +--- Attacker before - 26916 Goblin (ATT:4; DEF:5; THP:134577; LDMG:0) +--- Defender before - 88 AncientBehemoth (ATT:19; DEF:22; THP:26378; LDMG:0) +--- Attacker after - 26916 Goblin (ATT:4; DEF:5; THP:134577; LDMG:22205.7) +--- Defender after - 14 AncientBehemoth (ATT:19; DEF:22; THP:4173; LDMG:0) +--- Attacker before - 14 AncientBehemoth (ATT:19; DEF:22; THP:4173; LDMG:0) +--- Defender before - 26916 Goblin (ATT:4; DEF:5; THP:134577; LDMG:0) +--- Attacker after - 14 AncientBehemoth (ATT:19; DEF:22; THP:4173; LDMG:1064) +--- Defender after - 26703 Goblin (ATT:4; DEF:1; THP:133513; LDMG:0) +--- Attacker before - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:0) +--- Defender before - 26703 Goblin (ATT:4; DEF:5; THP:133513; LDMG:0) +--- Attacker after - 426 CyclopsKing (ATT:20; DEF:16; THP:29772; LDMG:13419) +--- Defender after - 24019 Goblin (ATT:4; DEF:5; THP:120094; LDMG:0) +--- Attacker before - 24019 Goblin (ATT:4; DEF:5; THP:120094; LDMG:0) +--- Defender before - 14 AncientBehemoth (ATT:19; DEF:22; THP:4173; LDMG:0) +--- Attacker after - 24019 Goblin (ATT:4; DEF:5; THP:120094; LDMG:19815.675) +--- Defender after - 0 AncientBehemoth (ATT:19; DEF:22; THP:0; LDMG:0) diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/.gitignore b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/.gitignore similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/.gitignore rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/.gitignore diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/ArmyOfCreatures.Tests.csproj b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/ArmyOfCreatures.Tests.csproj similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/ArmyOfCreatures.Tests.csproj rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/ArmyOfCreatures.Tests.csproj diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/BattleManagerTests.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/BattleManagerTests.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/BattleManagerTests.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/BattleManagerTests.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/ExtendedCreaturesFactoryTests.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/ExtendedCreaturesFactoryTests.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/ExtendedCreaturesFactoryTests.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/ExtendedCreaturesFactoryTests.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/Properties/AssemblyInfo.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/Properties/AssemblyInfo.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/Properties/AssemblyInfo.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/Properties/AssemblyInfo.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/packages.config b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/packages.config similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/packages.config rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/packages.config diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.sln b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.sln similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.sln rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.sln diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/App.config b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/App.config similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/App.config rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/App.config diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/ArmyOfCreatures.csproj b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/ArmyOfCreatures.csproj similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/ArmyOfCreatures.csproj rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/ArmyOfCreatures.csproj diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/AddCommand.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/AddCommand.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/AddCommand.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/AddCommand.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/AttackCommand.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/AttackCommand.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/AttackCommand.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/AttackCommand.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/CommandManager.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/CommandManager.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/CommandManager.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/CommandManager.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ExitCommand.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ExitCommand.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ExitCommand.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ExitCommand.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ICommand.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ICommand.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ICommand.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ICommand.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ICommandManager.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ICommandManager.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ICommandManager.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ICommandManager.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/SkipCommand.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/SkipCommand.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/SkipCommand.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/SkipCommand.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/ConsoleWriter.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/ConsoleWriter.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/ConsoleWriter.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/ConsoleWriter.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Program.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Program.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Program.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Program.cs diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/BattleManagerWithThreeArmies.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/BattleManagerWithThreeArmies.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/BattleManagerWithThreeArmies.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/BattleManagerWithThreeArmies.cs index 2b40e8e..2329727 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/BattleManagerWithThreeArmies.cs +++ b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/BattleManagerWithThreeArmies.cs @@ -1,57 +1,57 @@ -namespace ArmyOfCreatures.Extended -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using ArmyOfCreatures.Logic; - using ArmyOfCreatures.Logic.Battles; - - public class BattleManagerWithThreeArmies : BattleManager - { - private readonly ICollection thirdArmyCreatures; - - public BattleManagerWithThreeArmies(ICreaturesFactory creaturesFactory, ILogger logger) - : base(creaturesFactory, logger) - { - this.thirdArmyCreatures = new List(); - } - - protected override void AddCreaturesByIdentifier(CreatureIdentifier creatureIdentifier, ICreaturesInBattle creaturesInBattle) - { - if (creatureIdentifier == null) - { - throw new ArgumentNullException("creatureIdentifier"); - } - - if (creaturesInBattle == null) - { - throw new ArgumentNullException("creaturesInBattle"); - } - - if (creatureIdentifier.ArmyNumber == 3) - { - this.thirdArmyCreatures.Add(creaturesInBattle); - } - else - { - base.AddCreaturesByIdentifier(creatureIdentifier, creaturesInBattle); - } - } - - protected override ICreaturesInBattle GetByIdentifier(CreatureIdentifier identifier) - { - if (identifier == null) - { - throw new ArgumentNullException("identifier"); - } - - if (identifier.ArmyNumber == 3) - { - return this.thirdArmyCreatures.FirstOrDefault(x => x.Creature.GetType().Name == identifier.CreatureType); - } - - return base.GetByIdentifier(identifier); - } - } -} +namespace ArmyOfCreatures.Extended +{ + using System; + using System.Collections.Generic; + using System.Linq; + + using ArmyOfCreatures.Logic; + using ArmyOfCreatures.Logic.Battles; + + public class BattleManagerWithThreeArmies : BattleManager + { + private readonly ICollection thirdArmyCreatures; + + public BattleManagerWithThreeArmies(ICreaturesFactory creaturesFactory, ILogger logger) + : base(creaturesFactory, logger) + { + this.thirdArmyCreatures = new List(); + } + + protected override void AddCreaturesByIdentifier(CreatureIdentifier creatureIdentifier, ICreaturesInBattle creaturesInBattle) + { + if (creatureIdentifier == null) + { + throw new ArgumentNullException("creatureIdentifier"); + } + + if (creaturesInBattle == null) + { + throw new ArgumentNullException("creaturesInBattle"); + } + + if (creatureIdentifier.ArmyNumber == 3) + { + this.thirdArmyCreatures.Add(creaturesInBattle); + } + else + { + base.AddCreaturesByIdentifier(creatureIdentifier, creaturesInBattle); + } + } + + protected override ICreaturesInBattle GetByIdentifier(CreatureIdentifier identifier) + { + if (identifier == null) + { + throw new ArgumentNullException("identifier"); + } + + if (identifier.ArmyNumber == 3) + { + return this.thirdArmyCreatures.FirstOrDefault(x => x.Creature.GetType().Name == identifier.CreatureType); + } + + return base.GetByIdentifier(identifier); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/Goblin.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/Goblin.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/Goblin.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/Goblin.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/Griffin.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/Griffin.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/Griffin.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/Griffin.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/ExtendedCreaturesFactory.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/ExtendedCreaturesFactory.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/ExtendedCreaturesFactory.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/ExtendedCreaturesFactory.cs index b767d0a..f502eb6 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/ExtendedCreaturesFactory.cs +++ b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/ExtendedCreaturesFactory.cs @@ -1,28 +1,28 @@ -namespace ArmyOfCreatures.Extended -{ - using ArmyOfCreatures.Extended.Creatures; - using ArmyOfCreatures.Logic; - using ArmyOfCreatures.Logic.Creatures; - - public class ExtendedCreaturesFactory : CreaturesFactory - { - public override Creature CreateCreature(string name) - { - switch (name) - { - case "AncientBehemoth": - return new AncientBehemoth(); - case "CyclopsKing": - return new CyclopsKing(); - case "Goblin": - return new Goblin(); - case "Griffin": - return new Griffin(); - case "WolfRaider": - return new WolfRaider(); - default: - return base.CreateCreature(name); - } - } - } -} +namespace ArmyOfCreatures.Extended +{ + using ArmyOfCreatures.Extended.Creatures; + using ArmyOfCreatures.Logic; + using ArmyOfCreatures.Logic.Creatures; + + public class ExtendedCreaturesFactory : CreaturesFactory + { + public override Creature CreateCreature(string name) + { + switch (name) + { + case "AncientBehemoth": + return new AncientBehemoth(); + case "CyclopsKing": + return new CyclopsKing(); + case "Goblin": + return new Goblin(); + case "Griffin": + return new Griffin(); + case "WolfRaider": + return new WolfRaider(); + default: + return base.CreateCreature(name); + } + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/AddAttackWhenSkip.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/AddAttackWhenSkip.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/AddAttackWhenSkip.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/AddAttackWhenSkip.cs index e841f5a..f21c623 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/AddAttackWhenSkip.cs +++ b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/AddAttackWhenSkip.cs @@ -1,38 +1,38 @@ -namespace ArmyOfCreatures.Extended.Specialties -{ - using System; - using System.Globalization; - - using ArmyOfCreatures.Logic.Battles; - using ArmyOfCreatures.Logic.Specialties; - - public class AddAttackWhenSkip : Specialty - { - private readonly int attackToAdd; - - public AddAttackWhenSkip(int attackToAdd) - { - if (attackToAdd < 1 || attackToAdd > 10) - { - throw new ArgumentOutOfRangeException("attackToAdd", "attackToAdd should be between 1 and 10, inclusive"); - } - - this.attackToAdd = attackToAdd; - } - - public override void ApplyOnSkip(ICreaturesInBattle skipCreature) - { - if (skipCreature == null) - { - throw new ArgumentNullException("skipCreature"); - } - - skipCreature.PermanentAttack += this.attackToAdd; - } - - public override string ToString() - { - return string.Format(CultureInfo.InvariantCulture, "{0}({1})", base.ToString(), this.attackToAdd); - } - } -} +namespace ArmyOfCreatures.Extended.Specialties +{ + using System; + using System.Globalization; + + using ArmyOfCreatures.Logic.Battles; + using ArmyOfCreatures.Logic.Specialties; + + public class AddAttackWhenSkip : Specialty + { + private readonly int attackToAdd; + + public AddAttackWhenSkip(int attackToAdd) + { + if (attackToAdd < 1 || attackToAdd > 10) + { + throw new ArgumentOutOfRangeException("attackToAdd", "attackToAdd should be between 1 and 10, inclusive"); + } + + this.attackToAdd = attackToAdd; + } + + public override void ApplyOnSkip(ICreaturesInBattle skipCreature) + { + if (skipCreature == null) + { + throw new ArgumentNullException("skipCreature"); + } + + skipCreature.PermanentAttack += this.attackToAdd; + } + + public override string ToString() + { + return string.Format(CultureInfo.InvariantCulture, "{0}({1})", base.ToString(), this.attackToAdd); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/DoubleAttackWhenAttacking.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/DoubleAttackWhenAttacking.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/DoubleAttackWhenAttacking.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/DoubleAttackWhenAttacking.cs index 7a7cfd4..071e335 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/DoubleAttackWhenAttacking.cs +++ b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/DoubleAttackWhenAttacking.cs @@ -1,50 +1,50 @@ -namespace ArmyOfCreatures.Extended.Specialties -{ - using System; - using System.Globalization; - - using ArmyOfCreatures.Logic.Battles; - using ArmyOfCreatures.Logic.Specialties; - - public class DoubleAttackWhenAttacking : Specialty - { - private int rounds; - - public DoubleAttackWhenAttacking(int rounds) - { - if (rounds <= 0) - { - throw new ArgumentOutOfRangeException("rounds", "The number of rounds should be greater than 0"); - } - - this.rounds = rounds; - } - - public override void ApplyWhenAttacking(ICreaturesInBattle attackerWithSpecialty, ICreaturesInBattle defender) - { - if (attackerWithSpecialty == null) - { - throw new ArgumentNullException("attackerWithSpecialty"); - } - - if (defender == null) - { - throw new ArgumentNullException("defender"); - } - - if (this.rounds <= 0) - { - // Effect expires after fixed number of rounds - return; - } - - attackerWithSpecialty.CurrentAttack *= 2; - this.rounds--; - } - - public override string ToString() - { - return string.Format(CultureInfo.InvariantCulture, "{0}({1})", base.ToString(), this.rounds); - } - } -} +namespace ArmyOfCreatures.Extended.Specialties +{ + using System; + using System.Globalization; + + using ArmyOfCreatures.Logic.Battles; + using ArmyOfCreatures.Logic.Specialties; + + public class DoubleAttackWhenAttacking : Specialty + { + private int rounds; + + public DoubleAttackWhenAttacking(int rounds) + { + if (rounds <= 0) + { + throw new ArgumentOutOfRangeException("rounds", "The number of rounds should be greater than 0"); + } + + this.rounds = rounds; + } + + public override void ApplyWhenAttacking(ICreaturesInBattle attackerWithSpecialty, ICreaturesInBattle defender) + { + if (attackerWithSpecialty == null) + { + throw new ArgumentNullException("attackerWithSpecialty"); + } + + if (defender == null) + { + throw new ArgumentNullException("defender"); + } + + if (this.rounds <= 0) + { + // Effect expires after fixed number of rounds + return; + } + + attackerWithSpecialty.CurrentAttack *= 2; + this.rounds--; + } + + public override string ToString() + { + return string.Format(CultureInfo.InvariantCulture, "{0}({1})", base.ToString(), this.rounds); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/DoubleDamage.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/DoubleDamage.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/DoubleDamage.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/DoubleDamage.cs index 1850336..7944f96 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Specialties/DoubleDamage.cs +++ b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Specialties/DoubleDamage.cs @@ -1,58 +1,58 @@ -namespace ArmyOfCreatures.Extended.Specialties -{ - using System; - using System.Globalization; - - using ArmyOfCreatures.Logic.Battles; - using ArmyOfCreatures.Logic.Specialties; - - public class DoubleDamage : Specialty - { - private int rounds; - - public DoubleDamage(int rounds) - { - if (rounds <= 0) - { - throw new ArgumentOutOfRangeException("rounds", "The number of rounds should be greater than 0"); - } - - if (rounds > 10) - { - throw new ArgumentOutOfRangeException("rounds", "The number of rounds should be less than or equal to 10"); - } - - this.rounds = rounds; - } - - public override decimal ChangeDamageWhenAttacking( - ICreaturesInBattle attackerWithSpecialty, - ICreaturesInBattle defender, - decimal currentDamage) - { - if (attackerWithSpecialty == null) - { - throw new ArgumentNullException("attackerWithSpecialty"); - } - - if (defender == null) - { - throw new ArgumentNullException("defender"); - } - - if (this.rounds <= 0) - { - // Effect expires after fixed number of rounds - return currentDamage; - } - - this.rounds--; - return currentDamage * 2; - } - - public override string ToString() - { - return string.Format(CultureInfo.InvariantCulture, "{0}({1})", base.ToString(), this.rounds); - } - } -} +namespace ArmyOfCreatures.Extended.Specialties +{ + using System; + using System.Globalization; + + using ArmyOfCreatures.Logic.Battles; + using ArmyOfCreatures.Logic.Specialties; + + public class DoubleDamage : Specialty + { + private int rounds; + + public DoubleDamage(int rounds) + { + if (rounds <= 0) + { + throw new ArgumentOutOfRangeException("rounds", "The number of rounds should be greater than 0"); + } + + if (rounds > 10) + { + throw new ArgumentOutOfRangeException("rounds", "The number of rounds should be less than or equal to 10"); + } + + this.rounds = rounds; + } + + public override decimal ChangeDamageWhenAttacking( + ICreaturesInBattle attackerWithSpecialty, + ICreaturesInBattle defender, + decimal currentDamage) + { + if (attackerWithSpecialty == null) + { + throw new ArgumentNullException("attackerWithSpecialty"); + } + + if (defender == null) + { + throw new ArgumentNullException("defender"); + } + + if (this.rounds <= 0) + { + // Effect expires after fixed number of rounds + return currentDamage; + } + + this.rounds--; + return currentDamage * 2; + } + + public override string ToString() + { + return string.Format(CultureInfo.InvariantCulture, "{0}({1})", base.ToString(), this.rounds); + } + } +} diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/BattleManager.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/BattleManager.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/BattleManager.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/BattleManager.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/CreatureIdentifier.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/CreatureIdentifier.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/CreatureIdentifier.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/CreatureIdentifier.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/CreaturesInBattle.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/CreaturesInBattle.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/CreaturesInBattle.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/CreaturesInBattle.cs diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/IBattleManager.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/IBattleManager.cs similarity index 96% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/IBattleManager.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/IBattleManager.cs index 174ce7f..db4a405 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/IBattleManager.cs +++ b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/IBattleManager.cs @@ -1,11 +1,11 @@ -namespace ArmyOfCreatures.Logic.Battles -{ - public interface IBattleManager - { - void AddCreatures(CreatureIdentifier creatureIdentifier, int count); - - void Attack(CreatureIdentifier attackerIdentifier, CreatureIdentifier defenderIdentifier); - - void Skip(CreatureIdentifier creatureIdentifier); - } -} +namespace ArmyOfCreatures.Logic.Battles +{ + public interface IBattleManager + { + void AddCreatures(CreatureIdentifier creatureIdentifier, int count); + + void Attack(CreatureIdentifier attackerIdentifier, CreatureIdentifier defenderIdentifier); + + void Skip(CreatureIdentifier creatureIdentifier); + } +} diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Angel.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Angel.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Angel.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Angel.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Archangel.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Archangel.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Archangel.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Archangel.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Behemoth.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Behemoth.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Behemoth.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Behemoth.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Creature.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Creature.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Creature.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Creature.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Devil.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Devil.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Devil.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Devil.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/CreaturesFactory.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/CreaturesFactory.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/CreaturesFactory.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/CreaturesFactory.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/ICreaturesFactory.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/ICreaturesFactory.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/ICreaturesFactory.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/ICreaturesFactory.cs diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ILogger.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/ILogger.cs similarity index 94% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ILogger.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/ILogger.cs index 93e8563..0918e69 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ILogger.cs +++ b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/ILogger.cs @@ -1,7 +1,7 @@ -namespace ArmyOfCreatures.Logic -{ - public interface ILogger - { - void WriteLine(string line); - } -} +namespace ArmyOfCreatures.Logic +{ + public interface ILogger + { + void WriteLine(string line); + } +} diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/AddDefenseWhenSkip.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/AddDefenseWhenSkip.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/AddDefenseWhenSkip.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/AddDefenseWhenSkip.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/DoubleDefenseWhenDefending.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/DoubleDefenseWhenDefending.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/DoubleDefenseWhenDefending.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/DoubleDefenseWhenDefending.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Hate.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Hate.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Hate.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Hate.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/ReduceEnemyDefenseByPercentage.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/ReduceEnemyDefenseByPercentage.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/ReduceEnemyDefenseByPercentage.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/ReduceEnemyDefenseByPercentage.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Resurrection.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Resurrection.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Resurrection.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Resurrection.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Specialty.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Specialty.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Specialty.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Specialty.cs diff --git a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Properties/AssemblyInfo.cs b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Properties/AssemblyInfo.cs similarity index 100% rename from Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Properties/AssemblyInfo.cs rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Properties/AssemblyInfo.cs diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/Settings.StyleCop b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/Settings.StyleCop similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/Settings.StyleCop rename to Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/Settings.StyleCop index 5d63c81..b49c38e 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/Settings.StyleCop +++ b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/Settings.StyleCop @@ -1,219 +1,219 @@ - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + + \ No newline at end of file diff --git "a/Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/\320\242estsRequirements.md" "b/Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/\320\242estsRequirements.md" similarity index 100% rename from "Topics/04. Workshop(Trainers)/Live-Demo-Morning-Lecture/\320\242estsRequirements.md" rename to "Topics/04. Workshop (Trainers)/Live-Demo-Morning-Lecture/\320\242estsRequirements.md" diff --git a/Topics/05. Workshop(Students)/README.md b/Topics/05. Workshop (Students)/README.md similarity index 100% rename from Topics/05. Workshop(Students)/README.md rename to Topics/05. Workshop (Students)/README.md diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Common/ValidatorTests.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Common/ValidatorTests.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Common/ValidatorTests.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Common/ValidatorTests.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Cosmetics.Tests.csproj b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Cosmetics.Tests.csproj similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Cosmetics.Tests.csproj rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Cosmetics.Tests.csproj diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Engine/CommandTests.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Engine/CommandTests.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Engine/CommandTests.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Engine/CommandTests.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Engine/CosmeticsEngineTests.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Engine/CosmeticsEngineTests.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Engine/CosmeticsEngineTests.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Engine/CosmeticsEngineTests.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Engine/CosmeticsFactoryTests.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Engine/CosmeticsFactoryTests.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Engine/CosmeticsFactoryTests.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Engine/CosmeticsFactoryTests.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Engine/Mocks/MockedCosmeticsEngine.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Engine/Mocks/MockedCosmeticsEngine.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Engine/Mocks/MockedCosmeticsEngine.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Engine/Mocks/MockedCosmeticsEngine.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Products/CategoryTests.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Products/CategoryTests.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Products/CategoryTests.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Products/CategoryTests.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Products/Mocks/MockedCategory.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Products/Mocks/MockedCategory.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Products/Mocks/MockedCategory.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Products/Mocks/MockedCategory.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Products/Mocks/MockedShoppingCart.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Products/Mocks/MockedShoppingCart.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Products/Mocks/MockedShoppingCart.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Products/Mocks/MockedShoppingCart.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Products/ShampooTests.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Products/ShampooTests.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Products/ShampooTests.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Products/ShampooTests.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Products/ShoppingCartTests.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Products/ShoppingCartTests.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Products/ShoppingCartTests.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Products/ShoppingCartTests.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Products/ToothpasteTests.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Products/ToothpasteTests.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Products/ToothpasteTests.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Products/ToothpasteTests.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Properties/AssemblyInfo.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Properties/AssemblyInfo.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/Properties/AssemblyInfo.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/Properties/AssemblyInfo.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/packages.config b/Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/packages.config similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.Tests/packages.config rename to Topics/05. Workshop (Students)/Solution/Cosmetics.Tests/packages.config diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics.sln b/Topics/05. Workshop (Students)/Solution/Cosmetics.sln similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics.sln rename to Topics/05. Workshop (Students)/Solution/Cosmetics.sln diff --git a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/App.config b/Topics/05. Workshop (Students)/Solution/Cosmetics/App.config similarity index 97% rename from Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/App.config rename to Topics/05. Workshop (Students)/Solution/Cosmetics/App.config index fad249e..8e15646 100644 --- a/Topics/04. Workshop(Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/App.config +++ b/Topics/05. Workshop (Students)/Solution/Cosmetics/App.config @@ -1,6 +1,6 @@ - - - - - + + + + + \ No newline at end of file diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Common/GenderType.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Common/GenderType.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Common/GenderType.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Common/GenderType.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Common/GlobalErrorMessages.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Common/GlobalErrorMessages.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Common/GlobalErrorMessages.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Common/GlobalErrorMessages.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Common/UsageType.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Common/UsageType.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Common/UsageType.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Common/UsageType.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Common/Validator.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Common/Validator.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Common/Validator.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Common/Validator.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/ICategory.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/ICategory.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/ICategory.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/ICategory.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/ICommand.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/ICommand.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/ICommand.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/ICommand.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/ICommandParser.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/ICommandParser.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/ICommandParser.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/ICommandParser.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/ICosmeticsFactory.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/ICosmeticsFactory.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/ICosmeticsFactory.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/ICosmeticsFactory.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/IEngine.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/IEngine.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/IEngine.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/IEngine.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/IProduct.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/IProduct.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/IProduct.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/IProduct.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/IShampoo.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/IShampoo.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/IShampoo.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/IShampoo.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/IShoppingCart.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/IShoppingCart.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/IShoppingCart.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/IShoppingCart.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/IToothpaste.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/IToothpaste.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Contracts/IToothpaste.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Contracts/IToothpaste.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Cosmetics.csproj b/Topics/05. Workshop (Students)/Solution/Cosmetics/Cosmetics.csproj similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Cosmetics.csproj rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Cosmetics.csproj diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/CosmeticsProgram.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/CosmeticsProgram.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/CosmeticsProgram.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/CosmeticsProgram.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Engine/Command.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Engine/Command.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Engine/Command.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Engine/Command.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Engine/ConsoleCommandParser.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Engine/ConsoleCommandParser.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Engine/ConsoleCommandParser.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Engine/ConsoleCommandParser.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Engine/CosmeticsEngine.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Engine/CosmeticsEngine.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Engine/CosmeticsEngine.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Engine/CosmeticsEngine.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Engine/CosmeticsFactory.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Engine/CosmeticsFactory.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Engine/CosmeticsFactory.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Engine/CosmeticsFactory.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Products/Category.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Products/Category.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Products/Category.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Products/Category.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Products/Product.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Products/Product.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Products/Product.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Products/Product.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Products/Shampoo.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Products/Shampoo.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Products/Shampoo.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Products/Shampoo.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Products/ShoppingCart.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Products/ShoppingCart.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Products/ShoppingCart.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Products/ShoppingCart.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Products/Toothpaste.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Products/Toothpaste.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Products/Toothpaste.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Products/Toothpaste.cs diff --git a/Topics/05. Workshop(Students)/Solution/Cosmetics/Properties/AssemblyInfo.cs b/Topics/05. Workshop (Students)/Solution/Cosmetics/Properties/AssemblyInfo.cs similarity index 100% rename from Topics/05. Workshop(Students)/Solution/Cosmetics/Properties/AssemblyInfo.cs rename to Topics/05. Workshop (Students)/Solution/Cosmetics/Properties/AssemblyInfo.cs diff --git a/Topics/05. Workshop(Students)/Tests/test.000.001.in.txt b/Topics/05. Workshop (Students)/Tests/test.000.001.in.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.000.001.in.txt rename to Topics/05. Workshop (Students)/Tests/test.000.001.in.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.000.001.out.txt b/Topics/05. Workshop (Students)/Tests/test.000.001.out.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.000.001.out.txt rename to Topics/05. Workshop (Students)/Tests/test.000.001.out.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.001.in.txt b/Topics/05. Workshop (Students)/Tests/test.001.in.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.001.in.txt rename to Topics/05. Workshop (Students)/Tests/test.001.in.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.001.out.txt b/Topics/05. Workshop (Students)/Tests/test.001.out.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.001.out.txt rename to Topics/05. Workshop (Students)/Tests/test.001.out.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.002.in.txt b/Topics/05. Workshop (Students)/Tests/test.002.in.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.002.in.txt rename to Topics/05. Workshop (Students)/Tests/test.002.in.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.002.out.txt b/Topics/05. Workshop (Students)/Tests/test.002.out.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.002.out.txt rename to Topics/05. Workshop (Students)/Tests/test.002.out.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.003.in.txt b/Topics/05. Workshop (Students)/Tests/test.003.in.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.003.in.txt rename to Topics/05. Workshop (Students)/Tests/test.003.in.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.003.out.txt b/Topics/05. Workshop (Students)/Tests/test.003.out.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.003.out.txt rename to Topics/05. Workshop (Students)/Tests/test.003.out.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.004.in.txt b/Topics/05. Workshop (Students)/Tests/test.004.in.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.004.in.txt rename to Topics/05. Workshop (Students)/Tests/test.004.in.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.004.out.txt b/Topics/05. Workshop (Students)/Tests/test.004.out.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.004.out.txt rename to Topics/05. Workshop (Students)/Tests/test.004.out.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.005.in.txt b/Topics/05. Workshop (Students)/Tests/test.005.in.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.005.in.txt rename to Topics/05. Workshop (Students)/Tests/test.005.in.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.005.out.txt b/Topics/05. Workshop (Students)/Tests/test.005.out.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.005.out.txt rename to Topics/05. Workshop (Students)/Tests/test.005.out.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.006.in.txt b/Topics/05. Workshop (Students)/Tests/test.006.in.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.006.in.txt rename to Topics/05. Workshop (Students)/Tests/test.006.in.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.006.out.txt b/Topics/05. Workshop (Students)/Tests/test.006.out.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.006.out.txt rename to Topics/05. Workshop (Students)/Tests/test.006.out.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.007.in.txt b/Topics/05. Workshop (Students)/Tests/test.007.in.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.007.in.txt rename to Topics/05. Workshop (Students)/Tests/test.007.in.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.007.out.txt b/Topics/05. Workshop (Students)/Tests/test.007.out.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.007.out.txt rename to Topics/05. Workshop (Students)/Tests/test.007.out.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.008.in.txt b/Topics/05. Workshop (Students)/Tests/test.008.in.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.008.in.txt rename to Topics/05. Workshop (Students)/Tests/test.008.in.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.008.out.txt b/Topics/05. Workshop (Students)/Tests/test.008.out.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.008.out.txt rename to Topics/05. Workshop (Students)/Tests/test.008.out.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.009.in.txt b/Topics/05. Workshop (Students)/Tests/test.009.in.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.009.in.txt rename to Topics/05. Workshop (Students)/Tests/test.009.in.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.009.out.txt b/Topics/05. Workshop (Students)/Tests/test.009.out.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.009.out.txt rename to Topics/05. Workshop (Students)/Tests/test.009.out.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.010.in.txt b/Topics/05. Workshop (Students)/Tests/test.010.in.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.010.in.txt rename to Topics/05. Workshop (Students)/Tests/test.010.in.txt diff --git a/Topics/05. Workshop(Students)/Tests/test.010.out.txt b/Topics/05. Workshop (Students)/Tests/test.010.out.txt similarity index 100% rename from Topics/05. Workshop(Students)/Tests/test.010.out.txt rename to Topics/05. Workshop (Students)/Tests/test.010.out.txt diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel.Tests/IntergalacticTravel.Tests.csproj b/Topics/06. Exam (Skeleton)/IntergalacticTravel.Tests/IntergalacticTravel.Tests.csproj new file mode 100644 index 0000000..e19d22b --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel.Tests/IntergalacticTravel.Tests.csproj @@ -0,0 +1,148 @@ + + + + + Debug + AnyCPU + {2EC3F83D-ADA2-4124-9400-3C03CFE77BF9} + Library + Properties + IntergalacticTravel.Tests + IntergalacticTravel.Tests + v4.5.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll + True + + + ..\packages\MSTest.TestFramework.1.0.1-preview\lib\net451\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + True + + + ..\packages\MSTest.TestFramework.1.0.1-preview\lib\net451\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + True + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.dll + False + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.Mdb.dll + False + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.Pdb.dll + False + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\Mono.Cecil.Rocks.dll + False + + + ..\packages\Moq.4.5.16\lib\net45\Moq.dll + True + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\nunit.engine.dll + False + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\nunit.engine.api.dll + False + + + ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll + True + + + ..\packages\NUnit3TestAdapter.3.4.0\lib\NUnit3.TestAdapter.dll + False + + + + ..\packages\JustMock.2016.2.426.1\lib\Net35\Telerik.JustMock.dll + True + + + + + + + + + + + + + + + + + + + {ADCEB8BC-59F3-4087-8A14-2EA6FE723F78} + IntergalacticTravel + + + + + + + False + + + False + + + False + + + False + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + \ No newline at end of file diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel.Tests/Properties/AssemblyInfo.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e1d8b67 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IntergalacticTravel.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("IntergalacticTravel.Tests")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2ec3f83d-ada2-4124-9400-3c03cfe77bf9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel.Tests/packages.config b/Topics/06. Exam (Skeleton)/IntergalacticTravel.Tests/packages.config new file mode 100644 index 0000000..13ee76c --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel.Tests/packages.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel.sln b/Topics/06. Exam (Skeleton)/IntergalacticTravel.sln new file mode 100644 index 0000000..97bf583 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntergalacticTravel", "IntergalacticTravel\IntergalacticTravel.csproj", "{ADCEB8BC-59F3-4087-8A14-2EA6FE723F78}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntergalacticTravel.Tests", "IntergalacticTravel.Tests\IntergalacticTravel.Tests.csproj", "{2EC3F83D-ADA2-4124-9400-3C03CFE77BF9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ADCEB8BC-59F3-4087-8A14-2EA6FE723F78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ADCEB8BC-59F3-4087-8A14-2EA6FE723F78}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ADCEB8BC-59F3-4087-8A14-2EA6FE723F78}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ADCEB8BC-59F3-4087-8A14-2EA6FE723F78}.Release|Any CPU.Build.0 = Release|Any CPU + {2EC3F83D-ADA2-4124-9400-3C03CFE77BF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2EC3F83D-ADA2-4124-9400-3C03CFE77BF9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2EC3F83D-ADA2-4124-9400-3C03CFE77BF9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2EC3F83D-ADA2-4124-9400-3C03CFE77BF9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/BusinessOwner.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/BusinessOwner.cs new file mode 100644 index 0000000..389b10b --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/BusinessOwner.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using IntergalacticTravel.Contracts; + +namespace IntergalacticTravel +{ + internal class BusinessOwner : Unit, IBusinessOwner + { + private readonly ICollection teleportStations; + + public BusinessOwner(int identificationNumber, string nickName, IEnumerable teleportStations) : base(identificationNumber, nickName) + { + this.teleportStations = (ICollection)teleportStations; + } + + public ICollection TeleportStations + { + get + { + return this.teleportStations; + } + } + + public void CollectProfits() + { + foreach(var teleportStation in this.teleportStations) + { + var profit = teleportStation.PayProfits(this); + this.Resources.Add(profit); + } + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Constants/GlobalConstants.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Constants/GlobalConstants.cs new file mode 100644 index 0000000..492767a --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Constants/GlobalConstants.cs @@ -0,0 +1,9 @@ +namespace IntergalacticTravel.Constants +{ + public class GlobalConstants + { + public const uint BronzeCoinsDefaultAmount = 0; + public const uint SilverCoinsDefaultAmount = 0; + public const uint GoldCoinsDefaultAmount = 0; + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IBusinessOwner.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IBusinessOwner.cs new file mode 100644 index 0000000..0f1f8de --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IBusinessOwner.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace IntergalacticTravel.Contracts +{ + public interface IBusinessOwner : IUnit + { + ICollection TeleportStations { get; } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IGPSCoordinates.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IGPSCoordinates.cs new file mode 100644 index 0000000..058a18e --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IGPSCoordinates.cs @@ -0,0 +1,12 @@ +namespace IntergalacticTravel.Contracts +{ + /// + /// Represents the Global Positioning System Coordinates + /// + public interface IGPSCoordinates + { + double Longtitude { get; } + + double Latitude { get; } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IGalaxy.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IGalaxy.cs new file mode 100644 index 0000000..7fc8fc6 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IGalaxy.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace IntergalacticTravel.Contracts +{ + public interface IGalaxy : INameable + { + ICollection Planets { get; } + } +} \ No newline at end of file diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/ILocation.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/ILocation.cs new file mode 100644 index 0000000..cd97d1b --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/ILocation.cs @@ -0,0 +1,9 @@ +namespace IntergalacticTravel.Contracts +{ + public interface ILocation + { + IPlanet Planet { get; } + + IGPSCoordinates Coordinates { get; } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/INameable.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/INameable.cs new file mode 100644 index 0000000..58b921a --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/INameable.cs @@ -0,0 +1,7 @@ +namespace IntergalacticTravel.Contracts +{ + public interface INameable + { + string Name { get; } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IPath.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IPath.cs new file mode 100644 index 0000000..abfe643 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IPath.cs @@ -0,0 +1,9 @@ +namespace IntergalacticTravel.Contracts +{ + public interface IPath + { + ILocation TargetLocation { get; } + + IResources Cost { get; } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IPlanet.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IPlanet.cs new file mode 100644 index 0000000..aec72b3 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IPlanet.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace IntergalacticTravel.Contracts +{ + public interface IPlanet : INameable + { + IGalaxy Galaxy { get; } + + ICollection Units { get; } + } +} \ No newline at end of file diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IResources.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IResources.cs new file mode 100644 index 0000000..a81198f --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IResources.cs @@ -0,0 +1,19 @@ +namespace IntergalacticTravel.Contracts +{ + public interface IResources + { + uint GoldCoins { get; set; } + + uint SilverCoins { get; set; } + + uint BronzeCoins { get; set; } + + void Add(IResources payment); + + bool IsEqualTo(IResources resource); + + void Clear(); + + IResources Clone(); + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IResourcesFactory.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IResourcesFactory.cs new file mode 100644 index 0000000..9e340a8 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IResourcesFactory.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IntergalacticTravel.Contracts +{ + public interface IResourcesFactory + { + IResources GetResources(string command); + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/ITeleportStation.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/ITeleportStation.cs new file mode 100644 index 0000000..12e167e --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/ITeleportStation.cs @@ -0,0 +1,9 @@ +namespace IntergalacticTravel.Contracts +{ + public interface ITeleportStation + { + void TeleportUnit(IUnit unitToTeleport, ILocation targetLocation); + + IResources PayProfits(IBusinessOwner owner); + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IUnit.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IUnit.cs new file mode 100644 index 0000000..3e1925e --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Contracts/IUnit.cs @@ -0,0 +1,19 @@ +namespace IntergalacticTravel.Contracts +{ + public interface IUnit + { + int IdentificationNumber { get; } + + string NickName { get; } + + IResources Resources { get; } + + ILocation CurrentLocation { get; set; } + + ILocation PreviousLocation { get; set; } + + bool CanPay(IResources cost); + + IResources Pay(IResources cost); + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/InsufficientResourcesException.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/InsufficientResourcesException.cs new file mode 100644 index 0000000..ae7d373 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/InsufficientResourcesException.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.Serialization; + +namespace IntergalacticTravel.Exceptions +{ + public class InsufficientResourcesException : Exception + { + public InsufficientResourcesException() + { + } + + public InsufficientResourcesException(string message) : base(message) + { + } + + public InsufficientResourcesException(string message, Exception innerException) : base(message, innerException) + { + } + + protected InsufficientResourcesException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/InvalidTeleportationLocationException.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/InvalidTeleportationLocationException.cs new file mode 100644 index 0000000..f0bf4c4 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/InvalidTeleportationLocationException.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.Serialization; + +namespace IntergalacticTravel.Exceptions +{ + public class InvalidTeleportationLocationException : Exception + { + public InvalidTeleportationLocationException() + { + } + + public InvalidTeleportationLocationException(string message) : base(message) + { + } + + public InvalidTeleportationLocationException(string message, Exception innerException) : base(message, innerException) + { + } + + protected InvalidTeleportationLocationException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/InvalidUnitCreationCommandException.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/InvalidUnitCreationCommandException.cs new file mode 100644 index 0000000..0a3a586 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/InvalidUnitCreationCommandException.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.Serialization; + +namespace IntergalacticTravel.Exceptions +{ + public class InvalidUnitCreationCommandException : Exception + { + public InvalidUnitCreationCommandException() + { + } + + public InvalidUnitCreationCommandException(string message) : base(message) + { + } + + public InvalidUnitCreationCommandException(string message, Exception innerException) : base(message, innerException) + { + } + + protected InvalidUnitCreationCommandException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/LocationNotFoundException.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/LocationNotFoundException.cs new file mode 100644 index 0000000..5ece743 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/LocationNotFoundException.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.Serialization; + +namespace IntergalacticTravel.Exceptions +{ + public class LocationNotFoundException : Exception + { + public LocationNotFoundException() + { + } + + public LocationNotFoundException(string message) : base(message) + { + } + + public LocationNotFoundException(string message, Exception innerException) : base(message, innerException) + { + } + + protected LocationNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/TeleportOutOfRangeException.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/TeleportOutOfRangeException.cs new file mode 100644 index 0000000..62f8180 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Exceptions/TeleportOutOfRangeException.cs @@ -0,0 +1,32 @@ +using System; +using System.Runtime.Serialization; + +namespace IntergalacticTravel.Exceptions +{ + public class TeleportOutOfRangeException : ArgumentOutOfRangeException + { + public TeleportOutOfRangeException() + { + } + + public TeleportOutOfRangeException(string paramName) : base(paramName) + { + } + + public TeleportOutOfRangeException(string message, Exception innerException) : base(message, innerException) + { + } + + public TeleportOutOfRangeException(string paramName, string message) : base(paramName, message) + { + } + + public TeleportOutOfRangeException(string paramName, object actualValue, string message) : base(paramName, actualValue, message) + { + } + + protected TeleportOutOfRangeException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Extensions/IEnumerableExtensions.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Extensions/IEnumerableExtensions.cs new file mode 100644 index 0000000..1433c4d --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Extensions/IEnumerableExtensions.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using System.Linq; + +namespace IntergalacticTravel.Extensions +{ + public static class IEnumerableExtensions + { + public static bool IsNullOrEmpty(this IEnumerable enumeration) + { + return enumeration == null || + enumeration.Count() == 0; + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Extensions/ObjectExtensions.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Extensions/ObjectExtensions.cs new file mode 100644 index 0000000..2d0d79d --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Extensions/ObjectExtensions.cs @@ -0,0 +1,15 @@ +namespace IntergalacticTravel.Extensions +{ + public static class ObjectExtensions + { + public static bool IsNull(this object obj) + { + return obj == null; + } + + public static bool IsNotNull(this object obj) + { + return obj != null; + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/IntergalacticTravel.csproj b/Topics/06. Exam (Skeleton)/IntergalacticTravel/IntergalacticTravel.csproj new file mode 100644 index 0000000..d7f00ba --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/IntergalacticTravel.csproj @@ -0,0 +1,82 @@ + + + + + Debug + AnyCPU + {ADCEB8BC-59F3-4087-8A14-2EA6FE723F78} + Library + Properties + IntergalacticTravel + IntergalacticTravel + v4.5.2 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Lacaille.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Lacaille.cs new file mode 100644 index 0000000..b254f32 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Lacaille.cs @@ -0,0 +1,12 @@ +namespace IntergalacticTravel +{ + /// + /// Imma dummy class + /// + internal class Lacaille : Unit + { + public Lacaille(int identificationNumber, string nickName) : base(identificationNumber, nickName) + { + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Luyten.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Luyten.cs new file mode 100644 index 0000000..f096643 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Luyten.cs @@ -0,0 +1,12 @@ +namespace IntergalacticTravel +{ + /// + /// Imma dummy class + /// + internal class Luyten : Unit + { + public Luyten(int identificationNumber, string nickName) : base(identificationNumber, nickName) + { + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Procyon.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Procyon.cs new file mode 100644 index 0000000..8b7e0de --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Procyon.cs @@ -0,0 +1,12 @@ +namespace IntergalacticTravel +{ + /// + /// Imma dummy class + /// + internal class Procyon : Unit + { + public Procyon(int identificationNumber, string nickName) : base(identificationNumber, nickName) + { + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Properties/AssemblyInfo.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..61f66f6 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Properties/AssemblyInfo.cs @@ -0,0 +1,40 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IntergalacticTravel")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("IntergalacticTravel")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("adceb8bc-59f3-4087-8a14-2ea6fe723f78")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + +//[assembly: InternalsVisibleTo("IntergalacticTravel.Tests")] +//[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] +//[assembly: InternalsVisibleTo("Telerik.JustMock")] \ No newline at end of file diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Resources.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Resources.cs new file mode 100644 index 0000000..4718a6d --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Resources.cs @@ -0,0 +1,99 @@ +using System; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; +using IntergalacticTravel.Constants; +using IntergalacticTravel.Contracts; + +namespace IntergalacticTravel +{ + [Serializable] + public class Resources : IResources + { + private uint bronzeCoins; + private uint silverCoins; + private uint goldCoins; + + public Resources() + : this(GlobalConstants.BronzeCoinsDefaultAmount, + GlobalConstants.SilverCoinsDefaultAmount, + GlobalConstants.GoldCoinsDefaultAmount) + { + } + + public Resources(uint bronzeCoins, uint silverCoins, uint goldCoins) + { + this.bronzeCoins = bronzeCoins; + this.silverCoins = silverCoins; + this.goldCoins = goldCoins; + } + + public uint BronzeCoins + { + get + { + return this.bronzeCoins; + } + set + { + this.bronzeCoins = value; + } + } + + public uint GoldCoins + { + get + { + return this.goldCoins; + } + set + { + this.goldCoins = value; + } + } + + public uint SilverCoins + { + get + { + return this.silverCoins; + } + set + { + this.silverCoins = value; + } + } + + public void Add(IResources payment) + { + this.bronzeCoins += payment.BronzeCoins; + this.silverCoins += payment.SilverCoins; + this.goldCoins += payment.GoldCoins; + } + + public bool IsEqualTo(IResources resource) + { + return resource.GoldCoins == this.goldCoins && + resource.SilverCoins == this.silverCoins && + resource.BronzeCoins == this.bronzeCoins; + } + + public void Clear() + { + this.bronzeCoins = 0; + this.silverCoins = 0; + this.goldCoins = 0; + } + + public IResources Clone() + { + using (var stream = new MemoryStream()) + { + var formatter = new BinaryFormatter(); + formatter.Serialize(stream, this); + stream.Seek(0, SeekOrigin.Begin); + + return (IResources)formatter.Deserialize(stream); + } + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/ResourcesFactory.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/ResourcesFactory.cs new file mode 100644 index 0000000..d5ca9e0 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/ResourcesFactory.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using IntergalacticTravel.Contracts; + +namespace IntergalacticTravel +{ + public class ResourcesFactory : IResourcesFactory + { + private const int FirstLetterIndex = 0; + private const int ResourceAmountIndex = 1; + private const int ResourcesParametersStartIndex = 2; + private const char BronzeKey = 'b'; + private const char SilverKey = 's'; + private const char GoldKey = 'g'; + private const char OpeningBracket = '('; + private const char ClosingBracket = ')'; + + private readonly IDictionary resourcesParameters; + + public ResourcesFactory() + { + this.resourcesParameters = new Dictionary(); + } + + public IResources GetResources(string command) + { + try + { + this.BuildResourcesParametersDictionary(command); + + return new Resources( + this.resourcesParameters[BronzeKey], + this.resourcesParameters[SilverKey], + this.resourcesParameters[GoldKey]); + } + catch (Exception exc) + { + if (exc.GetType() == typeof(OverflowException)) + { + throw new OverflowException(); + } + + throw new InvalidOperationException("Invalid command"); + } + } + + private void BuildResourcesParametersDictionary(string command) + { + var commandParams = command.Split(' '); + + for (int i = ResourcesParametersStartIndex; i < commandParams.Length; i++) + { + var resourceType = commandParams[i]; + var key = resourceType[FirstLetterIndex]; + var paramz = resourceType.Split( + new char[] { OpeningBracket, ClosingBracket }, + StringSplitOptions.RemoveEmptyEntries); + + var value = uint.Parse(paramz[ResourceAmountIndex]); + + this.resourcesParameters[key] = value; + } + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/TeleportStation.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/TeleportStation.cs new file mode 100644 index 0000000..49db271 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/TeleportStation.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using IntergalacticTravel.Contracts; +using IntergalacticTravel.Exceptions; +using IntergalacticTravel.Extensions; + +namespace IntergalacticTravel +{ + public class TeleportStation : ITeleportStation + { + protected readonly IResources resources; + protected readonly IBusinessOwner owner; + protected readonly ILocation location; + protected readonly IEnumerable galacticMap; + + public TeleportStation(IBusinessOwner owner, IEnumerable galacticMap, ILocation location) + { + this.owner = owner; + this.galacticMap = galacticMap; + this.location = location; + this.resources = new Resources(); + } + + public void TeleportUnit(IUnit unitToTeleport, ILocation targetLocation) + { + IPath pathToTheTargetPlanet; + + this.ValidateThatTeleportationServiceIsApplicable(unitToTeleport, targetLocation, out pathToTheTargetPlanet); + + this.GetPayment(pathToTheTargetPlanet, unitToTeleport); + + this.ChangeUnitLocation(pathToTheTargetPlanet, unitToTeleport, targetLocation); + } + + public IResources PayProfits(IBusinessOwner owner) + { + if (this.owner.IdentificationNumber != owner.IdentificationNumber) + { + throw new UnauthorizedAccessException("Payments are allowed only to the owner"); + } + + var payment = this.resources.Clone(); + this.resources.Clear(); + + return payment; + } + + private void ChangeUnitLocation(IPath pathToTheTargetPlanet, IUnit unitToTeleport, ILocation targetLocation) + { + pathToTheTargetPlanet.TargetLocation.Planet.Units.Add(unitToTeleport); + unitToTeleport.CurrentLocation.Planet.Units.Remove(unitToTeleport); + unitToTeleport.PreviousLocation = unitToTeleport.CurrentLocation; + unitToTeleport.CurrentLocation = targetLocation; + } + + private void GetPayment(IPath pathToTheTargetPlanet, IUnit unitToTeleport) + { + var cost = pathToTheTargetPlanet.Cost; + var payment = unitToTeleport.Pay(cost); + this.resources.Add(payment); + } + + private bool LocationsMatch(ILocation firstLocation, ILocation secondLocation) + { + return firstLocation.Planet.Galaxy.Name == secondLocation.Planet.Galaxy.Name && + firstLocation.Planet.Name == secondLocation.Planet.Name; + } + + private bool LocationsAndCoordinatesMatch(ILocation firstLocation, ILocation secondLocation) + { + return firstLocation.Coordinates.Latitude == secondLocation.Coordinates.Latitude && + firstLocation.Coordinates.Longtitude == secondLocation.Coordinates.Longtitude && + this.LocationsMatch(firstLocation, secondLocation); + } + + private void ValidateThatTeleportationServiceIsApplicable(IUnit unitToTeleport, ILocation targetLocation, out IPath pathToTheTargetPlanet) + { + if (unitToTeleport.IsNull()) + { + throw new ArgumentNullException("unitToTeleport"); + } + + if (targetLocation.IsNull()) + { + throw new ArgumentNullException("destination"); + } + + if (!this.LocationsMatch(this.location, unitToTeleport.CurrentLocation)) + { + throw new TeleportOutOfRangeException("unitToTeleport.CurrentLocation"); + } + + var pathsToTheTargetGalaxy = galacticMap + .Where(path => path.TargetLocation.Planet.Galaxy.Name == targetLocation.Planet.Galaxy.Name) + .ToList(); + if (pathsToTheTargetGalaxy.IsNullOrEmpty()) + { + throw new LocationNotFoundException("A path to a Galaxy with the provided name cannot be found in the TeleportStation's galactic map."); + } + + pathToTheTargetPlanet = pathsToTheTargetGalaxy.FirstOrDefault(path => path.TargetLocation.Planet.Name == targetLocation.Planet.Name); + if (pathToTheTargetPlanet.IsNull()) + { + throw new LocationNotFoundException("A path to a Planet with the provided name cannot be found in the TeleportStation's galactic map."); + } + + foreach (var unitInCity in pathToTheTargetPlanet.TargetLocation.Planet.Units) + { + if (this.LocationsAndCoordinatesMatch(targetLocation, unitInCity.CurrentLocation)) + { + throw new InvalidTeleportationLocationException("There is already a unit placed on the desired location. Cannot activate the teleportation service because the units will overlap."); + } + } + + if (!unitToTeleport.CanPay(pathToTheTargetPlanet.Cost)) + { + throw new InsufficientResourcesException("The unit cannot be teleported, because THERE AIN'T NO SUCH THING AS A FREE LUNCH."); + } + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/Unit.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Unit.cs new file mode 100644 index 0000000..8b7d689 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/Unit.cs @@ -0,0 +1,86 @@ +using IntergalacticTravel.Contracts; + +namespace IntergalacticTravel +{ + internal class Unit : IUnit + { + private ILocation currentLocation; + private ILocation previousLocation; + private readonly int identificationNumber; + private readonly string nickName; + private readonly IResources resources; + + public Unit(int identificationNumber, string nickName) + { + this.identificationNumber = identificationNumber; + this.nickName = nickName; + this.resources = new Resources(); + } + + public ILocation CurrentLocation + { + get + { + return this.currentLocation; + } + + set + { + this.currentLocation = value; + } + } + + public int IdentificationNumber + { + get + { + return this.identificationNumber; + } + } + + public string NickName + { + get + { + return this.nickName; + } + } + + public ILocation PreviousLocation + { + get + { + return this.previousLocation; + } + + set + { + this.previousLocation = value; + } + } + + public IResources Resources + { + get + { + return this.resources; + } + } + + public bool CanPay(IResources cost) + { + return this.resources.GoldCoins >= cost.GoldCoins && + this.resources.SilverCoins >= cost.SilverCoins && + this.resources.BronzeCoins >= cost.BronzeCoins; + } + + public IResources Pay(IResources cost) + { + this.resources.BronzeCoins -= cost.BronzeCoins; + this.resources.SilverCoins -= cost.SilverCoins; + this.resources.GoldCoins -= cost.GoldCoins; + + return new Resources(cost.BronzeCoins, cost.SilverCoins, cost.GoldCoins); + } + } +} diff --git a/Topics/06. Exam (Skeleton)/IntergalacticTravel/UnitsFactory.cs b/Topics/06. Exam (Skeleton)/IntergalacticTravel/UnitsFactory.cs new file mode 100644 index 0000000..da337c3 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/IntergalacticTravel/UnitsFactory.cs @@ -0,0 +1,34 @@ +using System; +using System.Linq; +using System.Reflection; +using IntergalacticTravel.Contracts; +using IntergalacticTravel.Exceptions; + +namespace IntergalacticTravel +{ + public class UnitsFactory + { + private const int UnitTypeIndex = 2; + private const int UnitNameIndex = 3; + private const int UnitIdIndex = 4; + + public IUnit GetUnit(string command) + { + try + { + var commandParams = command.Split(' '); + var unitType = commandParams[UnitTypeIndex]; + var unitName = commandParams[UnitNameIndex]; + var unitId = commandParams[UnitIdIndex]; + + var typeToInstantiate = Assembly.Load("IntergalacticTravel").GetTypes().FirstOrDefault(x => x.Name == unitType); + return (IUnit)Activator.CreateInstance(typeToInstantiate, int.Parse(unitId), unitName); + } + catch (Exception) + { + throw new InvalidUnitCreationCommandException(); + } + + } + } +} diff --git a/Topics/06. Exam (Skeleton)/README.html b/Topics/06. Exam (Skeleton)/README.html new file mode 100644 index 0000000..99879d7 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/README.html @@ -0,0 +1,591 @@ + + + + + README + + +

logo

+

Unit Testing with C# – Practical exam - 09 August 2016

+

IntergalacticTravel

+
+

Description

+

You are given an already built software modules. Figure out how the different modules are working. Check out the test requirements, to know exactly what you must test. For a warm-up - start with the tests that look trivial to you (those that you know you can implement in seconds). Think of the different testing strategies you learned during the course - Extending classes, Mocking dependencies, Testing private members through the class public API, etc. Follow the best practices for unit testing that we discussed in our lectures and workshops.

+

Requirements

+

Test cases for IntergalacticTravel.UnitsFactory (5 tests)

+
    +
  1. GetUnit should return new Procyon unit, when a valid corresponding command is passed (i.e. "create unit Procyon Gosho 1");

    +
  2. +
  3. GetUnit should return new Luyten unit, when a valid corresponding command is passed (i.e. "create unit Luyten Pesho 2");

    +
  4. +
  5. GetUnit should return new Lacaille unit, when a valid corresponding command is passed (i.e. "create unit Lacaille Tosho 3");

    +
  6. +
  7. GetUnit should throw InvalidUnitCreationCommandException, when the command passed is not in the valid format described above. (Check for at least 2 different cases)

    +
  8. +
+

Test cases for IntergalacticTravel.ResourcesFactory (10 tests)

+
    +
  1. GetResources should return a newly created Resources object with correctly set up properties(Gold, Bronze and Silver coins), no matter what the order of the parameters is, when the input string is in the correct format. (Check with all possible cases):

    +

    Example: The following lines should all create a new Resources object with 40 Bronze Coins, 30 Silver Coins and 20 Gold Coins.
    create resources gold(20) silver(30) bronze(40)
    create resources gold(20) bronze(40) silver(30)
    create resources silver(30) bronze(40) gold(20)
    create resources silver(30) gold(20) bronze(40)
    create resources bronze(40) gold(20) silver(30)
    create resources bronze(40) silver(30) gold(20)

    +
  2. +
  3. GetResources should throw InvalidOperationException, which contains the string "command", when the input string represents an invalid command. (Check with at least 2 different cases).
    Invalid commands are any commands that does not follow the pattern described above.

    +

    Example:
    create resources x y z
    tansta resources a b
    absolutelyRandomStringThatMustNotBeAValidCommand

    +
  4. +
  5. GetResources should throw OverflowException, when the input string command is in the correct format, but any of the values that represent the resource amount is larger than uint.MaxValue. (Check with at least 2 different cases)

    +

    Example:
    create resources silver(10) gold(97853252356623523532) bronze(20)
    create resources silver(555555555555555555555555555555555) gold(97853252356623523532999999999) bronze(20)
    create resources silver(10) gold(20) bronze(4444444444444444444444444444444444444)

    +
  6. +
+

Test cases for IntergalacticTravel.TeleportStation (15 tests)

+
    +
  1. Constructor should set up all of the provided fields (owner, galacticMap & location), when a new TeleportStation is created with valid parameters passed to the constructor.

    +
  2. +
  3. TeleportUnit should throw ArgumentNullException, with a message that contains the string "unitToTeleport", when IUnit unitToTeleport is null.

    +
  4. +
  5. TeleportUnit should throw ArgumentNullException, with a message that contains the string "destination", when ILocation destination is null.

    +
  6. +
  7. TeleportUnit should throw TeleportOutOfRangeException, with a message that contains the string "unitToTeleport.CurrentLocation", when а unit is trying to use the TeleportStation from a distant location (another planet for example).

    +
  8. +
  9. TeleportUnit should throw InvalidTeleportationLocationException, with a message that contains the string "units will overlap" when trying to teleport a unit to a location which another unit has already taken.

    +
  10. +
  11. TeleportUnit should throw LocationNotFoundException, with a message that contains the string "Galaxy", when trying to teleport a unit to a Galaxy, which is not found in the locations list of the teleport station.

    +
  12. +
  13. TeleportUnit should throw LocationNotFoundException, with a message that contains the string "Planet", when trying to teleport a unit to a Planet, which is not found in the locations list of the teleport station.

    +
  14. +
  15. TeleportUnit should throw InsufficientResourcesException, with a message that contains the string "FREE LUNCH", when trying to teleport a unit to a given Location, but the service costs more than the unit's current available resources.

    +
  16. +
  17. TeleportUnit should require a payment from the unitToTeleport for the provided services, when all of the validations pass successfully and the unit is ready for teleportation.

    +
  18. +
  19. TeleportUnit should obtain a payment from the unitToTeleport for the provided services, when all of the validations pass successfully and the unit is ready for teleportation, and as a result - the amount of Resources of the TeleportStation must be increased by the amount of the payment.

    +
  20. +
  21. TeleportUnit should Set the unitToTeleport's previous location to unitToTeleport's current location, when all of the validations pass successfully and the unit is being teleported.

    +
  22. +
  23. TeleportUnit should Set the unitToTeleport's current location to targetLocation, when all of the validations pass successfully and the unit is being teleported.

    +
  24. +
  25. TeleportUnit should Add the unitToTeleport to the list of Units of the targetLocation (Planet.Units), when all of the validations pass successfully and the unit is on its way to being teleported.

    +
  26. +
  27. TeleportUnit should Remove the unitToTeleport from the list of Units of the unit's current location (Planet.Units), when all of the validations pass successfully and the unit is on its way to being teleported.

    +
  28. +
  29. PayProfits should return the total amount of profits(Resources) generated using the TeleportUnit service, when the argument passed represents the actual owner of the TeleportStation.

    +
  30. +
+

Test cases for IntergalacticTravel.BusinessOwner (1 test)

+
    +
  1. CollectProfits should increase the owner Resources by the total amount of Resources generated from the Teleport Stations that are in his possession.
  2. +
+

Test cases for IntergalacticTravel.Unit (3 tests)

+
    +
  1. Pay should throw NullReferenceException if the object passed is null.

    +
  2. +
  3. Pay should decrease the owner's amount of Resources by the amount of the cost.

    +
  4. +
  5. Pay should return Resource object with the amount of resources in the cost object.

    +
  6. +
+ diff --git a/Topics/06. Exam (Skeleton)/README.md b/Topics/06. Exam (Skeleton)/README.md new file mode 100644 index 0000000..ffd3a74 --- /dev/null +++ b/Topics/06. Exam (Skeleton)/README.md @@ -0,0 +1,93 @@ +![logo](https://raw.githubusercontent.com/TelerikAcademy/Common/master/logos/telerik-header-logo.png) + + +# Unit Testing with C# – Practical exam - 09 August 2016 +# IntergalacticTravel +--- + +# Description +You are given an already built software modules. Figure out how the different modules are working. Check out the test requirements, to know exactly what you must test. For a warm-up - start with the tests that look trivial to you (those that you know you can implement in seconds). Think of the different testing strategies you learned during the course - _**Extending classes, Mocking dependencies, Testing private members through the class public API, etc**_. Follow the _**best practices**_ for unit testing that we discussed in our _**lectures**_ and _**workshops**_. + + +# Requirements + +## Test cases for _**IntergalacticTravel.UnitsFactory**_ (5 tests) + + 1. **GetUnit** should return **new Procyon** unit, when a valid corresponding command is passed (i.e. "create unit Procyon Gosho 1"); + + - **GetUnit** should return **new Luyten** unit, when a valid corresponding command is passed (i.e. "create unit Luyten Pesho 2"); + + - **GetUnit** should return **new Lacaille** unit, when a valid corresponding command is passed (i.e. "create unit Lacaille Tosho 3"); + + - **GetUnit** should **throw InvalidUnitCreationCommandException**, when the command passed is not in the valid format described above. **(Check for at least 2 different cases)** + +## Test cases for _**IntergalacticTravel.ResourcesFactory**_ (10 tests) + + 1. **GetResources** should **return a newly created Resources** object with correctly set up properties(Gold, Bronze and Silver coins), no matter what the order of the parameters is, when the input string is in the correct format. **(Check with all possible cases)**: + + _**Example:**_ The following lines should all create a **new Resources object with 40 Bronze Coins, 30 Silver Coins and 20 Gold Coins**. + create resources **gold(20) silver(30) bronze(40)** + create resources **gold(20) bronze(40) silver(30)** + create resources **silver(30) bronze(40) gold(20)** + create resources **silver(30) gold(20) bronze(40)** + create resources **bronze(40) gold(20) silver(30)** + create resources **bronze(40) silver(30) gold(20)** + + - **GetResources** should throw **InvalidOperationException**, which contains the string **"command"**, when the input string represents an **invalid** command. **(Check with at least 2 different cases)**. + Invalid commands are any commands that does not follow the pattern described above. + + _**Example:**_ + create resources x y z + tansta resources a b + absolutelyRandomStringThatMustNotBeAValidCommand + + - **GetResources** should throw **OverflowException**, when the input string command is in the correct format, but any of the values that represent the resource amount is larger than **uint.MaxValue**. **(Check with at least 2 different cases)** + + _**Example:**_ +create resources silver(10) gold(97853252356623523532) bronze(20) +create resources silver(555555555555555555555555555555555) gold(97853252356623523532999999999) bronze(20) +create resources silver(10) gold(20) bronze(4444444444444444444444444444444444444) + +## Test cases for _**IntergalacticTravel.TeleportStation**_ (15 tests) + + 1. **Constructor** should set up all of the provided fields **(owner, galacticMap & location)**, when a **new TeleportStation** is created with valid parameters passed to the constructor. + + - **TeleportUnit** should throw **ArgumentNullException**, with a message that contains the string **"unitToTeleport"**, when **IUnit unitToTeleport** is null. + + - **TeleportUnit** should throw **ArgumentNullException**, with a message that contains the string **"destination"**, when **ILocation destination** is null. + + - **TeleportUnit** should throw **TeleportOutOfRangeException**, with a message that contains the string **"unitToTeleport.CurrentLocation"**, when а unit is trying to use the TeleportStation from a distant location (another planet for example). + + - **TeleportUnit** should throw **InvalidTeleportationLocationException**, with a message that contains the string **"units will overlap"** when trying to teleport a unit to a location which another unit has already taken. + + - **TeleportUnit** should throw **LocationNotFoundException**, with a message that contains the string **"Galaxy"**, when trying to teleport a unit to a Galaxy, which is not found in the locations list of the teleport station. + + - **TeleportUnit** should throw **LocationNotFoundException**, with a message that contains the string **"Planet"**, when trying to teleport a unit to a Planet, which is not found in the locations list of the teleport station. + + - **TeleportUnit** should throw **InsufficientResourcesException**, with a message that contains the string **"FREE LUNCH"**, when trying to teleport a unit to a given Location, but the service **costs** more than the unit's current available resources. + + - **TeleportUnit** should **require a payment** from the **unitToTeleport** for the provided services, when all of the validations pass successfully and the unit is ready for teleportation. + + - **TeleportUnit** should **obtain a payment** from the **unitToTeleport** for the provided services, when all of the validations pass successfully and the unit is ready for teleportation, and as a result - the amount of Resources of the **TeleportStation** must be increased by the amount of the payment. + + - **TeleportUnit** should **Set** the **unitToTeleport**'s previous location to **unitToTeleport**'s current location, when all of the validations pass successfully and the unit is being teleported. + + - **TeleportUnit** should **Set** the **unitToTeleport**'s current location to **targetLocation**, when all of the validations pass successfully and the unit is being teleported. + + - **TeleportUnit** should **Add** the **unitToTeleport** to the list of Units of the **targetLocation (Planet.Units)**, when all of the validations pass successfully and the unit is on its way to being teleported. + + - **TeleportUnit** should **Remove** the **unitToTeleport** from the list of Units of the **unit's current location (Planet.Units)**, when all of the validations pass successfully and the unit is on its way to being teleported. + + - **PayProfits** should **return the total amount of profits(Resources)** generated using the TeleportUnit service, when the argument passed represents the **actual owner** of the TeleportStation. + +## Test cases for _**IntergalacticTravel.BusinessOwner**_ (1 test) + + 1. **CollectProfits** should **increase the owner Resources** by the total amount of Resources generated from the Teleport Stations that are in his possession. + +## Test cases for _**IntergalacticTravel.Unit**_ (3 tests) + + 1. **Pay** should **throw NullReferenceException** if the object passed is null. + + 2. **Pay** should **decrease the owner's amount of Resources** by the amount of the cost. + + 3. **Pay** should **return Resource object** with the amount of resources in the cost object. \ No newline at end of file diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/BusinessOwner/CollectProfits_Should.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/BusinessOwner/CollectProfits_Should.cs new file mode 100644 index 0000000..26af7bc --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/BusinessOwner/CollectProfits_Should.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; +using IntergalacticTravel.Contracts; +using Moq; +using NUnit.Framework; + +namespace IntergalacticTravel.Tests.BusinessOwner +{ + [TestFixture] + public class CollectProfits_Should + { + [Test] + public void IncreaseTheOwnerResourcesByTheTotalAmountOfResourcesGeneratedFromTheTeleportStationsInHisPossession_WhenSuchStationsExist() + { + var ownerId = 71; + var ownerNickName = "Mecho"; + var teleportStationsCollection = new List(); + var owner = new IntergalacticTravel.BusinessOwner(ownerId, ownerNickName, teleportStationsCollection); + + var firstTeleportStationResourcesMock = new Mock(); + firstTeleportStationResourcesMock.Setup(x => x.BronzeCoins).Returns(200); + firstTeleportStationResourcesMock.Setup(x => x.SilverCoins).Returns(300); + firstTeleportStationResourcesMock.Setup(x => x.GoldCoins).Returns(400); + var firstTeleportStationMock = new Mock(); + firstTeleportStationMock.Setup(x => x.PayProfits(owner)).Returns(firstTeleportStationResourcesMock.Object); + + var secondTeleportStationResourcesMock = new Mock(); + secondTeleportStationResourcesMock.Setup(x => x.BronzeCoins).Returns(200); + secondTeleportStationResourcesMock.Setup(x => x.SilverCoins).Returns(300); + secondTeleportStationResourcesMock.Setup(x => x.GoldCoins).Returns(400); + var secondTeleportStationMock = new Mock(); + secondTeleportStationMock.Setup(x => x.PayProfits(owner)).Returns(secondTeleportStationResourcesMock.Object); + + owner.TeleportStations.Add(firstTeleportStationMock.Object); + owner.TeleportStations.Add(secondTeleportStationMock.Object); + + var expectedBronzeCoins = firstTeleportStationResourcesMock.Object.BronzeCoins + secondTeleportStationResourcesMock.Object.BronzeCoins; + var expectedSilverCoins = firstTeleportStationResourcesMock.Object.SilverCoins + secondTeleportStationResourcesMock.Object.SilverCoins; + var expectedGoldCoins = firstTeleportStationResourcesMock.Object.GoldCoins + secondTeleportStationResourcesMock.Object.GoldCoins; + + // Act + owner.CollectProfits(); + + var actualBronzeCoins = owner.Resources.BronzeCoins; + var actualSilverCoins = owner.Resources.SilverCoins; + var actualGoldCoins = owner.Resources.GoldCoins; + + // Assert + Assert.AreEqual(expectedBronzeCoins, actualBronzeCoins); + Assert.AreEqual(expectedSilverCoins, actualSilverCoins); + Assert.AreEqual(expectedGoldCoins, actualGoldCoins); + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/IntergalacticTravel.Tests.csproj b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/IntergalacticTravel.Tests.csproj new file mode 100644 index 0000000..d2fdc1e --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/IntergalacticTravel.Tests.csproj @@ -0,0 +1,152 @@ + + + + Debug + AnyCPU + {2EC3F83D-ADA2-4124-9400-3C03CFE77BF9} + Library + Properties + IntergalacticTravel.Tests + IntergalacticTravel.Tests + v4.5.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll + True + + + ..\packages\NUnit3TestAdapter.3.4.1\lib\Mono.Cecil.dll + True + + + ..\packages\NUnit3TestAdapter.3.4.1\lib\Mono.Cecil.Mdb.dll + True + + + ..\packages\NUnit3TestAdapter.3.4.1\lib\Mono.Cecil.Pdb.dll + True + + + ..\packages\NUnit3TestAdapter.3.4.1\lib\Mono.Cecil.Rocks.dll + True + + + ..\packages\Moq.4.5.16\lib\net45\Moq.dll + True + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll + False + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll + False + + + ..\packages\NUnit3TestAdapter.3.4.1\lib\nunit.engine.dll + True + + + ..\packages\NUnit3TestAdapter.3.4.1\lib\nunit.engine.api.dll + True + + + ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll + True + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll + False + + + ..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll + False + + + ..\packages\NUnit3TestAdapter.3.4.1\lib\NUnit3.TestAdapter.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + {ADCEB8BC-59F3-4087-8A14-2EA6FE723F78} + IntergalacticTravel + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/Properties/AssemblyInfo.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e1d8b67 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IntergalacticTravel.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("IntergalacticTravel.Tests")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2ec3f83d-ada2-4124-9400-3c03cfe77bf9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/ResourcesFactory/GetResources_Should.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/ResourcesFactory/GetResources_Should.cs new file mode 100644 index 0000000..475f01f --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/ResourcesFactory/GetResources_Should.cs @@ -0,0 +1,64 @@ +using System; +using NUnit.Framework; + +namespace IntergalacticTravel.Tests.ResourcesFactory +{ + [TestFixture] + public class GetResources_Should + { + [TestCase("create resources gold(20) silver(30) bronze(40)")] + [TestCase("create resources gold(20) bronze(40) silver(30)")] + [TestCase("create resources silver(30) bronze(40) gold(20)")] + [TestCase("create resources silver(30) gold(20) bronze(40)")] + [TestCase("create resources bronze(40) gold(20) silver(30)")] + [TestCase("create resources bronze(40) silver(30) gold(20)")] + public void ReturnNewResourcesWithCorrectlySetUpProperties_WhenTheCommandPassedIsValid_NoMatterWhatIsTheOrderOfTheParameters(string command) + { + // Arrange + var expectedBronzeCoinsAmount = 40; + var expectedSilverCoinsAmount = 30; + var expectedGoldCoinsAmount = 20; + var resourcesFactory = new IntergalacticTravel.ResourcesFactory(); + + // Act + var actualResourcesAmount = resourcesFactory.GetResources(command); + + // Assert + Assert.AreEqual(expectedBronzeCoinsAmount, actualResourcesAmount.BronzeCoins); + Assert.AreEqual(expectedSilverCoinsAmount, actualResourcesAmount.SilverCoins); + Assert.AreEqual(expectedGoldCoinsAmount, actualResourcesAmount.GoldCoins); + } + + + [TestCase("create resources x y z")] + [TestCase("tansta resources a b")] + [TestCase("absolutelyRandomStringThatMustNotBeAValidCommand")] + public void ThrowInvalidOperationExceptionWhichContainsTheStringCommand_WhenTheInputStringRepresentsInvalidCommand(string invalidCommand) + { + // Arrange + var resourcesFactory = new IntergalacticTravel.ResourcesFactory(); + var expectedExceptionMessage = "command"; + + // Act & Assert + var exc = Assert.Throws( + () => resourcesFactory.GetResources(invalidCommand)); + var actualExceptionMessage = exc.Message; + + // Assert + StringAssert.Contains(expectedExceptionMessage, actualExceptionMessage); + } + + [TestCase("create resources silver(10) gold(97853252356623523532) bronze(20)")] + [TestCase("create resources silver(555555555555555555555555555555555) gold(97853252356623523532999999999) bronze(20)")] + [TestCase("create resources silver(10) gold(20) bronze(4444444444444444444444444444444444444)")] + public void ThrowOverflowException_WhenTheInputStringRepresentsValidCommandButAnyOfTheValuesThatRepresentTheResourceAmountIsLargerThanTheMaximumValueAllowed(string command) + { + // Arrange + var resourcesFactory = new IntergalacticTravel.ResourcesFactory(); + + // Act & Assert + Assert.Throws( + () => resourcesFactory.GetResources(command)); + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/TeleportStation/Constructor_Should.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/TeleportStation/Constructor_Should.cs new file mode 100644 index 0000000..78bf969 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/TeleportStation/Constructor_Should.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using IntergalacticTravel.Contracts; +using Moq; +using NUnit.Framework; + +namespace IntergalacticTravel.Tests.TeleportStation +{ + [TestFixture] + public class Constructor_Should + { + [Test] + public void SetupAllOfTheProvidedFields_WhenValidParametersArePased() + { + // Arrange + var locationMock = new Mock(); + var ownerMock = new Mock(); + var mapMock = new Mock>(); + var expectedMap = mapMock.Object; + var expectedOwner = ownerMock.Object; + var expectedLocation = locationMock.Object; + + // Act + var teleportStation = new ExtendedTeleportStation(expectedOwner, expectedMap, expectedLocation); + var actualOwner = teleportStation.Owner; + var actualMap = teleportStation.GalacticMap; + var actualLocation = teleportStation.Location; + + // Assert + Assert.AreSame(expectedOwner, actualOwner); + Assert.AreSame(expectedLocation, actualLocation); + Assert.AreSame(expectedMap, actualMap); + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/TeleportStation/PayProfits_Should.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/TeleportStation/PayProfits_Should.cs new file mode 100644 index 0000000..935b81e --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/TeleportStation/PayProfits_Should.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using IntergalacticTravel.Contracts; +using Moq; +using NUnit.Framework; + +namespace IntergalacticTravel.Tests.TeleportStation +{ + [TestFixture] + public class PayProfits_Should + { + [Test] + public void ReturnTheTotalAmountOfProfitsGeneratedUsingTheTeleportUnitService_WhenTheArgumentPassedRepresentsTheActualOwnerOfTheTeleportStation() + { + // Arrange + var planetName = "P1"; + var galaxyName = "G1"; + var longtitude = 45d; + var latitude = 45d; + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + teleportStationOwnerMock.Setup(x => x.IdentificationNumber).Returns(12412); + var targetLocationMock = new Mock(); + var unitToTeleportMock = new Mock(); + + var planetaryUnitMock = new Mock(); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude + 15d); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude + 15d); + + var targetLocationPlanetaryUnitsCollectionEnumeratorMock = new Mock>(); + targetLocationPlanetaryUnitsCollectionEnumeratorMock + .Setup(x => x.Current) + .Returns(planetaryUnitMock.Object) + .Callback( + () => + targetLocationPlanetaryUnitsCollectionEnumeratorMock + .Setup(x => x.Current) + .Returns((IUnit)null)); + + var targetLocationPlanetaryUnitsCollectionMock = new Mock>(); + targetLocationPlanetaryUnitsCollectionMock.Setup(x => x.GetEnumerator()).Returns(targetLocationPlanetaryUnitsCollectionEnumeratorMock.Object); + + var pathMock = new Mock(); + pathMock.Setup(x => x.Cost.BronzeCoins).Returns(10); + pathMock.Setup(x => x.Cost.SilverCoins).Returns(10); + pathMock.Setup(x => x.Cost.GoldCoins).Returns(10); + pathMock.Setup(x => x.TargetLocation.Planet.Name).Returns(planetName); + pathMock.Setup(x => x.TargetLocation.Planet.Galaxy.Name).Returns(galaxyName); + pathMock.Setup(x => x.TargetLocation.Planet.Units).Returns(targetLocationPlanetaryUnitsCollectionMock.Object); + + var currentUnitLocationPlanetaryUnitsCollectionEnumeratorMock = new Mock>(); + currentUnitLocationPlanetaryUnitsCollectionEnumeratorMock + .Setup(x => x.Current) + .Returns(unitToTeleportMock.Object) + .Callback( + () => + currentUnitLocationPlanetaryUnitsCollectionEnumeratorMock + .Setup(x => x.Current) + .Returns((IUnit)null)); + + var currentUnitLocationPlanetaryUnitsCollectionMock = new Mock>(); + currentUnitLocationPlanetaryUnitsCollectionMock.Setup(x => x.GetEnumerator()).Returns(currentUnitLocationPlanetaryUnitsCollectionEnumeratorMock.Object); + + var teleportStationMapMock = new List { pathMock.Object }; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock, teleportStationLocationMock.Object); + var initialTeleportStationResources = teleportStation.Resources.Clone(); + + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + unitToTeleportMock.Setup(x => x.CanPay(It.IsAny())).Returns(true); + unitToTeleportMock.Setup(x => x.Pay(pathMock.Object.Cost)).Returns(pathMock.Object.Cost); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Units).Returns(currentUnitLocationPlanetaryUnitsCollectionMock.Object); + + targetLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + targetLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + targetLocationMock.Setup(x => x.Coordinates.Latitude).Returns(latitude); + targetLocationMock.Setup(x => x.Coordinates.Longtitude).Returns(longtitude); + + teleportStationLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + teleportStationLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + + var expectedResourcesAmount = new Mock(); + expectedResourcesAmount.Setup(x => x.BronzeCoins).Returns(500); + expectedResourcesAmount.Setup(x => x.SilverCoins).Returns(400); + expectedResourcesAmount.Setup(x => x.GoldCoins).Returns(300); + teleportStation.Resources.Add(expectedResourcesAmount.Object); + + // Act + var actualResourcesAmount = teleportStation.PayProfits(teleportStationOwnerMock.Object); + + // Assert + Assert.AreEqual(expectedResourcesAmount.Object.BronzeCoins, actualResourcesAmount.BronzeCoins); + Assert.AreEqual(expectedResourcesAmount.Object.SilverCoins, actualResourcesAmount.SilverCoins); + Assert.AreEqual(expectedResourcesAmount.Object.GoldCoins, actualResourcesAmount.GoldCoins); + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/TeleportStation/TeleportUnit_Should.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/TeleportStation/TeleportUnit_Should.cs new file mode 100644 index 0000000..4553d84 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/TeleportStation/TeleportUnit_Should.cs @@ -0,0 +1,698 @@ +using System; +using System.Collections.Generic; +using IntergalacticTravel.Contracts; +using IntergalacticTravel.Exceptions; +using Moq; +using NUnit.Framework; + +namespace IntergalacticTravel.Tests.TeleportStation +{ + [TestFixture] + public class TeleportUnit_Should + { + [Test] + public void ThrowArgumentNullException_WhenTheParameterUnitToTeleportIsNull() + { + // Arrange + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var teleportStationMapMock = new Mock>(); + var targetLocationMock = new Mock(); + var unitToTeleport = (IUnit)null; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock.Object, teleportStationLocationMock.Object); + var expectedExceptionMessage = "unitToTeleport"; + + // Act & Assert + var exc = Assert.Throws( + () => teleportStation.TeleportUnit(unitToTeleport, targetLocationMock.Object)); + var actualExceptionMessage = exc.Message; + + // Assert + StringAssert.Contains(expectedExceptionMessage, actualExceptionMessage); + } + + [Test] + public void ThrowArgumentNullException_WhenTheParameterTargetLocationIsNull() + { + // Arrange + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var teleportStationMapMock = new Mock>(); + var unitToTeleportMock = new Mock(); + var targetLocation = (ILocation)null; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock.Object, teleportStationLocationMock.Object); + var expectedExceptionMessage = "destination"; + + // Act & Assert + var exc = Assert.Throws( + () => teleportStation.TeleportUnit(unitToTeleportMock.Object, targetLocation)); + var actualExceptionMessage = exc.Message; + + // Assert + StringAssert.Contains(expectedExceptionMessage, actualExceptionMessage); + } + + [Test] + public void ThrowTeleportOutOfRangeException_WhenUnitIsTryingToUseTheTeleportStationFromPlanetOrGalaxyDifferentThanThatOfTheStationItself() + { + // Arrange + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var teleportStationMapMock = new Mock>(); + var targetLocationMock = new Mock(); + var unitToTeleportMock = new Mock(); + + teleportStationLocationMock.Setup(x => x.Planet.Name).Returns("PLANET-1"); + teleportStationLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns("GALAXY-1"); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Name).Returns("PLANET-2"); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns("GALAXY-2"); + + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock.Object, teleportStationLocationMock.Object); + var expectedExceptionMessage = "unitToTeleport.CurrentLocation"; + + // Act & Assert + var exc = Assert.Throws( + () => teleportStation.TeleportUnit(unitToTeleportMock.Object, targetLocationMock.Object)); + var actualExceptionMessage = exc.Message; + + // Assert + StringAssert.Contains(expectedExceptionMessage, actualExceptionMessage); + } + + [Test] + public void ThrowInvalidTeleportationLocationException_WhenTryingToTeleportUnitToLocationWhichIsAlreadyTakenByAnotherUnit() + { + // Arrange + var expectedExceptionMessage = "units will overlap"; + var planetName = "P1"; + var galaxyName = "G1"; + var longtitude = 45d; + var latitude = 45d; + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var targetLocationMock = new Mock(); + var unitToTeleportMock = new Mock(); + + var pathMock = new Mock(); + pathMock.Setup(x => x.Cost.BronzeCoins).Returns(10); + pathMock.Setup(x => x.Cost.SilverCoins).Returns(10); + pathMock.Setup(x => x.Cost.GoldCoins).Returns(10); + pathMock.Setup(x => x.TargetLocation.Planet.Name).Returns(planetName); + pathMock.Setup(x => x.TargetLocation.Planet.Galaxy.Name).Returns(galaxyName); + + var planetaryUnitMock = new Mock(); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + + var planetaryUnitsList = new List { planetaryUnitMock.Object }; + pathMock.Setup(x => x.TargetLocation.Planet.Units).Returns(planetaryUnitsList); + + var teleportStationMapMock = new List { pathMock.Object }; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock, teleportStationLocationMock.Object); + + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + + targetLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + targetLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + targetLocationMock.Setup(x => x.Coordinates.Latitude).Returns(latitude); + targetLocationMock.Setup(x => x.Coordinates.Longtitude).Returns(longtitude); + + teleportStationLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + teleportStationLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + + // Act & Assert + var exc = Assert.Throws( + () => teleportStation.TeleportUnit(unitToTeleportMock.Object, targetLocationMock.Object)); + var actualExceptionMessage = exc.Message; + + // Assert + StringAssert.Contains(expectedExceptionMessage, actualExceptionMessage); + } + + [Test] + public void ThrowLocationNotFoundException_WhenTryingToTeleportUnitToGalaxyWhichDoesntExistInTheGalacticMapOfTheTeleportStation() + { + // Arrange + var expectedExceptionMessage = "Galaxy"; + var planetName = "P1"; + var galaxyName = "G1"; + var longtitude = 45d; + var latitude = 45d; + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var targetLocationMock = new Mock(); + var unitToTeleportMock = new Mock(); + + var pathMock = new Mock(); + pathMock.Setup(x => x.Cost.BronzeCoins).Returns(10); + pathMock.Setup(x => x.Cost.SilverCoins).Returns(10); + pathMock.Setup(x => x.Cost.GoldCoins).Returns(10); + pathMock.Setup(x => x.TargetLocation.Planet.Name).Returns(planetName); + pathMock.Setup(x => x.TargetLocation.Planet.Galaxy.Name).Returns("DifferentGalaxyName"); + + var planetaryUnitMock = new Mock(); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + + var planetaryUnitsList = new List { planetaryUnitMock.Object }; + pathMock.Setup(x => x.TargetLocation.Planet.Units).Returns(planetaryUnitsList); + + var teleportStationMapMock = new List { pathMock.Object }; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock, teleportStationLocationMock.Object); + + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + + targetLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + targetLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + targetLocationMock.Setup(x => x.Coordinates.Latitude).Returns(latitude); + targetLocationMock.Setup(x => x.Coordinates.Longtitude).Returns(longtitude); + + teleportStationLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + teleportStationLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + + // Act & Assert + var exc = Assert.Throws( + () => teleportStation.TeleportUnit(unitToTeleportMock.Object, targetLocationMock.Object)); + var actualExceptionMessage = exc.Message; + + // Assert + StringAssert.Contains(expectedExceptionMessage, actualExceptionMessage); + } + + [Test] + public void ThrowLocationNotFoundException_WhenTryingToTeleportUnitToPlanetWhichDoesntExistInTheGalacticMapOfTheTeleportStation() + { + // Arrange + var expectedExceptionMessage = "Planet"; + var planetName = "P1"; + var galaxyName = "G1"; + var longtitude = 45d; + var latitude = 45d; + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var targetLocationMock = new Mock(); + var unitToTeleportMock = new Mock(); + + var pathMock = new Mock(); + pathMock.Setup(x => x.Cost.BronzeCoins).Returns(10); + pathMock.Setup(x => x.Cost.SilverCoins).Returns(10); + pathMock.Setup(x => x.Cost.GoldCoins).Returns(10); + pathMock.Setup(x => x.TargetLocation.Planet.Name).Returns("DifferentPlanetName"); + pathMock.Setup(x => x.TargetLocation.Planet.Galaxy.Name).Returns(galaxyName); + + var planetaryUnitMock = new Mock(); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + + var planetaryUnitsList = new List { planetaryUnitMock.Object }; + pathMock.Setup(x => x.TargetLocation.Planet.Units).Returns(planetaryUnitsList); + + var teleportStationMapMock = new List { pathMock.Object }; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock, teleportStationLocationMock.Object); + + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + + targetLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + targetLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + targetLocationMock.Setup(x => x.Coordinates.Latitude).Returns(latitude); + targetLocationMock.Setup(x => x.Coordinates.Longtitude).Returns(longtitude); + + teleportStationLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + teleportStationLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + + // Act & Assert + var exc = Assert.Throws( + () => teleportStation.TeleportUnit(unitToTeleportMock.Object, targetLocationMock.Object)); + var actualExceptionMessage = exc.Message; + + // Assert + StringAssert.Contains(expectedExceptionMessage, actualExceptionMessage); + } + + [Test] + public void ThrowInsufficientResourcesException_WhenTryingToTeleportUnitButTheServiceCostsMoreThanTheUnitCurrentAvailableResources() + { + // Arrange + var expectedExceptionMessage = "FREE LUNCH"; + var planetName = "P1"; + var galaxyName = "G1"; + var longtitude = 45d; + var latitude = 45d; + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var targetLocationMock = new Mock(); + var unitToTeleportMock = new Mock(); + + var pathMock = new Mock(); + pathMock.Setup(x => x.Cost.BronzeCoins).Returns(10); + pathMock.Setup(x => x.Cost.SilverCoins).Returns(10); + pathMock.Setup(x => x.Cost.GoldCoins).Returns(10); + pathMock.Setup(x => x.TargetLocation.Planet.Name).Returns(planetName); + pathMock.Setup(x => x.TargetLocation.Planet.Galaxy.Name).Returns(galaxyName); + + var planetaryUnitMock = new Mock(); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude + 15d); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude + 15d); + + var planetaryUnitsList = new List { planetaryUnitMock.Object }; + pathMock.Setup(x => x.TargetLocation.Planet.Units).Returns(planetaryUnitsList); + + var teleportStationMapMock = new List { pathMock.Object }; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock, teleportStationLocationMock.Object); + + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + unitToTeleportMock.Setup(x => x.CanPay(It.IsAny())).Returns(false); + + targetLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + targetLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + targetLocationMock.Setup(x => x.Coordinates.Latitude).Returns(latitude); + targetLocationMock.Setup(x => x.Coordinates.Longtitude).Returns(longtitude); + + teleportStationLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + teleportStationLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + + // Act & Assert + var exc = Assert.Throws( + () => teleportStation.TeleportUnit(unitToTeleportMock.Object, targetLocationMock.Object)); + var actualExceptionMessage = exc.Message; + + // Assert + StringAssert.Contains(expectedExceptionMessage, actualExceptionMessage); + } + + [Test] + public void RequestPaymentFromTheUnitThatIsBeingTeleportedWithTheAmountOfPathCost_WhenTheValidationsPassSuccessfullyAndTheUnitsIsReadyForTeleportation() + { + // Arrange + var planetName = "P1"; + var galaxyName = "G1"; + var longtitude = 45d; + var latitude = 45d; + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var targetLocationMock = new Mock(); + var unitToTeleportMock = new Mock(); + + var pathMock = new Mock(); + pathMock.Setup(x => x.Cost.BronzeCoins).Returns(10); + pathMock.Setup(x => x.Cost.SilverCoins).Returns(10); + pathMock.Setup(x => x.Cost.GoldCoins).Returns(10); + pathMock.Setup(x => x.TargetLocation.Planet.Name).Returns(planetName); + pathMock.Setup(x => x.TargetLocation.Planet.Galaxy.Name).Returns(galaxyName); + + var planetaryUnitMock = new Mock(); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude + 15d); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude + 15d); + + var planetaryUnitsList = new List { planetaryUnitMock.Object }; + pathMock.Setup(x => x.TargetLocation.Planet.Units).Returns(planetaryUnitsList); + + var currentUnitLocationPlanetaryUnitsList = new List { unitToTeleportMock.Object }; + var teleportStationMapMock = new List { pathMock.Object }; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock, teleportStationLocationMock.Object); + + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + unitToTeleportMock.Setup(x => x.CanPay(It.IsAny())).Returns(true); + unitToTeleportMock.Setup(x => x.Pay(pathMock.Object.Cost)).Returns(pathMock.Object.Cost); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Units).Returns(currentUnitLocationPlanetaryUnitsList); + + targetLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + targetLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + targetLocationMock.Setup(x => x.Coordinates.Latitude).Returns(latitude); + targetLocationMock.Setup(x => x.Coordinates.Longtitude).Returns(longtitude); + + teleportStationLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + teleportStationLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + + // Act + teleportStation.TeleportUnit(unitToTeleportMock.Object, targetLocationMock.Object); + + // Assert + unitToTeleportMock.Verify(x => x.Pay(pathMock.Object.Cost), Times.Once()); + } + + [Test] + public void ObtainPaymentFromTheUnitThatIsBeingTeleportedWithTheAmountOfPathCost_WhenTheValidationsPassSuccessfullyAndTheUnitsIsReadyForTeleportation() + { + // Arrange + var planetName = "P1"; + var galaxyName = "G1"; + var longtitude = 45d; + var latitude = 45d; + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var targetLocationMock = new Mock(); + var unitToTeleportMock = new Mock(); + + var pathMock = new Mock(); + pathMock.Setup(x => x.Cost.BronzeCoins).Returns(10); + pathMock.Setup(x => x.Cost.SilverCoins).Returns(10); + pathMock.Setup(x => x.Cost.GoldCoins).Returns(10); + pathMock.Setup(x => x.TargetLocation.Planet.Name).Returns(planetName); + pathMock.Setup(x => x.TargetLocation.Planet.Galaxy.Name).Returns(galaxyName); + + var planetaryUnitMock = new Mock(); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude + 15d); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude + 15d); + + var planetaryUnitsList = new List { planetaryUnitMock.Object }; + pathMock.Setup(x => x.TargetLocation.Planet.Units).Returns(planetaryUnitsList); + var currentUnitLocationPlanetaryUnitsList = new List { unitToTeleportMock.Object }; + var teleportStationMapMock = new List { pathMock.Object }; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock, teleportStationLocationMock.Object); + var initialTeleportStationResources = teleportStation.Resources.Clone(); + + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + unitToTeleportMock.Setup(x => x.CanPay(It.IsAny())).Returns(true); + unitToTeleportMock.Setup(x => x.Pay(pathMock.Object.Cost)).Returns(pathMock.Object.Cost); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Units).Returns(currentUnitLocationPlanetaryUnitsList); + + targetLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + targetLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + targetLocationMock.Setup(x => x.Coordinates.Latitude).Returns(latitude); + targetLocationMock.Setup(x => x.Coordinates.Longtitude).Returns(longtitude); + + teleportStationLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + teleportStationLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + + var expectedBronzeCoins = initialTeleportStationResources.BronzeCoins + pathMock.Object.Cost.BronzeCoins; + var expectedSilverCoins = initialTeleportStationResources.SilverCoins + pathMock.Object.Cost.SilverCoins; + var expectedGoldCoins = initialTeleportStationResources.GoldCoins + pathMock.Object.Cost.GoldCoins; + + // Act + teleportStation.TeleportUnit(unitToTeleportMock.Object, targetLocationMock.Object); + var actualBronzeCoins = teleportStation.Resources.BronzeCoins; + var actualSilverCoins = teleportStation.Resources.SilverCoins; + var actualGoldcoins = teleportStation.Resources.GoldCoins; + + // Assert + Assert.AreEqual(expectedBronzeCoins, actualBronzeCoins); + Assert.AreEqual(expectedSilverCoins, actualSilverCoins); + Assert.AreEqual(expectedGoldCoins, actualGoldcoins); + } + + [Test] + public void SetTheUnitToTeleportPreviousLocationToHisCurrentLocation_WhenTheValidationsPassAndTheUnitIsBeingTeleported() + { + // Arrange + var planetName = "P1"; + var galaxyName = "G1"; + var longtitude = 45d; + var latitude = 45d; + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var targetLocationMock = new Mock(); + var unitToTeleportMock = new Mock(); + + var planetaryUnitMock = new Mock(); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude + 15d); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude + 15d); + + var planetaryUnitsList = new List { planetaryUnitMock.Object }; + + var pathMock = new Mock(); + pathMock.Setup(x => x.Cost.BronzeCoins).Returns(10); + pathMock.Setup(x => x.Cost.SilverCoins).Returns(10); + pathMock.Setup(x => x.Cost.GoldCoins).Returns(10); + pathMock.Setup(x => x.TargetLocation.Planet.Name).Returns(planetName); + pathMock.Setup(x => x.TargetLocation.Planet.Galaxy.Name).Returns(galaxyName); + pathMock.Setup(x => x.TargetLocation.Planet.Units).Returns(planetaryUnitsList); + + var currentUnitLocationPlanetaryUnitsList = new List { unitToTeleportMock.Object }; + var teleportStationMapMock = new List { pathMock.Object }; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock, teleportStationLocationMock.Object); + var initialTeleportStationResources = teleportStation.Resources.Clone(); + + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + unitToTeleportMock.Setup(x => x.CanPay(It.IsAny())).Returns(true); + unitToTeleportMock.Setup(x => x.Pay(pathMock.Object.Cost)).Returns(pathMock.Object.Cost); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Units).Returns(currentUnitLocationPlanetaryUnitsList); + + targetLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + targetLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + targetLocationMock.Setup(x => x.Coordinates.Latitude).Returns(latitude); + targetLocationMock.Setup(x => x.Coordinates.Longtitude).Returns(longtitude); + + teleportStationLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + teleportStationLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + + // Act + teleportStation.TeleportUnit(unitToTeleportMock.Object, targetLocationMock.Object); + + // Assert + unitToTeleportMock.VerifySet(x => x.PreviousLocation = x.CurrentLocation, Times.Once()); + } + + [Test] + public void SetTheUnitToTeleportCurrentLocationToTargetLocation_WhenTheValidationsPassAndTheUnitIsBeingTeleported() + { + // Arrange + var planetName = "P1"; + var galaxyName = "G1"; + var longtitude = 45d; + var latitude = 45d; + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var targetLocationMock = new Mock(); + var unitToTeleportMock = new Mock(); + + var planetaryUnitMock = new Mock(); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude + 15d); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude + 15d); + + var planetaryUnitsList = new List { planetaryUnitMock.Object }; + var currentUnitLocationPlanetaryUnitsList = new List { unitToTeleportMock.Object }; + + var pathMock = new Mock(); + pathMock.Setup(x => x.Cost.BronzeCoins).Returns(10); + pathMock.Setup(x => x.Cost.SilverCoins).Returns(10); + pathMock.Setup(x => x.Cost.GoldCoins).Returns(10); + pathMock.Setup(x => x.TargetLocation.Planet.Name).Returns(planetName); + pathMock.Setup(x => x.TargetLocation.Planet.Galaxy.Name).Returns(galaxyName); + pathMock.Setup(x => x.TargetLocation.Planet.Units).Returns(planetaryUnitsList); + + var teleportStationMapMock = new List { pathMock.Object }; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock, teleportStationLocationMock.Object); + var initialTeleportStationResources = teleportStation.Resources.Clone(); + + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + unitToTeleportMock.Setup(x => x.CanPay(It.IsAny())).Returns(true); + unitToTeleportMock.Setup(x => x.Pay(pathMock.Object.Cost)).Returns(pathMock.Object.Cost); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Units).Returns(currentUnitLocationPlanetaryUnitsList); + + targetLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + targetLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + targetLocationMock.Setup(x => x.Coordinates.Latitude).Returns(latitude); + targetLocationMock.Setup(x => x.Coordinates.Longtitude).Returns(longtitude); + + teleportStationLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + teleportStationLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + + // Act + teleportStation.TeleportUnit(unitToTeleportMock.Object, targetLocationMock.Object); + + // Assert + unitToTeleportMock.VerifySet(x => x.CurrentLocation = targetLocationMock.Object, Times.Once()); + } + + [Test] + public void AddTheUnitToTeleportToTheListOfUnitsOfTheTargetPlanet_WhenTheValidationsPassAndTheUnitIsBeingTeleported() + { + // Arrange + var planetName = "P1"; + var galaxyName = "G1"; + var longtitude = 45d; + var latitude = 45d; + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var targetLocationMock = new Mock(); + var unitToTeleportMock = new Mock(); + + var planetaryUnitMock = new Mock(); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude + 15d); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude + 15d); + + var targetLocationPlanetaryUnitsCollectionEnumeratorMock = new Mock>(); + targetLocationPlanetaryUnitsCollectionEnumeratorMock + .Setup(x => x.Current) + .Returns(planetaryUnitMock.Object) + .Callback( + () => + targetLocationPlanetaryUnitsCollectionEnumeratorMock + .Setup(x => x.Current) + .Returns((IUnit)null)); + + var targetLocationPlanetaryUnitsCollectionMock = new Mock>(); + targetLocationPlanetaryUnitsCollectionMock.Setup(x => x.GetEnumerator()).Returns(targetLocationPlanetaryUnitsCollectionEnumeratorMock.Object); + + var pathMock = new Mock(); + pathMock.Setup(x => x.Cost.BronzeCoins).Returns(10); + pathMock.Setup(x => x.Cost.SilverCoins).Returns(10); + pathMock.Setup(x => x.Cost.GoldCoins).Returns(10); + pathMock.Setup(x => x.TargetLocation.Planet.Name).Returns(planetName); + pathMock.Setup(x => x.TargetLocation.Planet.Galaxy.Name).Returns(galaxyName); + pathMock.Setup(x => x.TargetLocation.Planet.Units).Returns(targetLocationPlanetaryUnitsCollectionMock.Object); + + var currentUnitLocationPlanetaryUnitsCollectionEnumeratorMock = new Mock>(); + currentUnitLocationPlanetaryUnitsCollectionEnumeratorMock + .Setup(x => x.Current) + .Returns(unitToTeleportMock.Object) + .Callback( + () => + currentUnitLocationPlanetaryUnitsCollectionEnumeratorMock + .Setup(x => x.Current) + .Returns((IUnit)null)); + + var currentUnitLocationPlanetaryUnitsCollectionMock = new Mock>(); + currentUnitLocationPlanetaryUnitsCollectionMock.Setup(x => x.GetEnumerator()).Returns(currentUnitLocationPlanetaryUnitsCollectionEnumeratorMock.Object); + + var teleportStationMapMock = new List { pathMock.Object }; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock, teleportStationLocationMock.Object); + var initialTeleportStationResources = teleportStation.Resources.Clone(); + + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + unitToTeleportMock.Setup(x => x.CanPay(It.IsAny())).Returns(true); + unitToTeleportMock.Setup(x => x.Pay(pathMock.Object.Cost)).Returns(pathMock.Object.Cost); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Units).Returns(currentUnitLocationPlanetaryUnitsCollectionMock.Object); + + targetLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + targetLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + targetLocationMock.Setup(x => x.Coordinates.Latitude).Returns(latitude); + targetLocationMock.Setup(x => x.Coordinates.Longtitude).Returns(longtitude); + + teleportStationLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + teleportStationLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + + // Act + teleportStation.TeleportUnit(unitToTeleportMock.Object, targetLocationMock.Object); + + // Assert + targetLocationPlanetaryUnitsCollectionMock.Verify(x => x.Add(unitToTeleportMock.Object), Times.Once()); + } + + [Test] + public void RemoveTheUnitToTeleportFromTheListOfUnitsOfItsCurrentPlanet_WhenTheValidationsPassAndTheUnitIsBeingTeleported() + { + // Arrange + var planetName = "P1"; + var galaxyName = "G1"; + var longtitude = 45d; + var latitude = 45d; + var teleportStationLocationMock = new Mock(); + var teleportStationOwnerMock = new Mock(); + var targetLocationMock = new Mock(); + var unitToTeleportMock = new Mock(); + + var planetaryUnitMock = new Mock(); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude + 15d); + planetaryUnitMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude + 15d); + + var targetLocationPlanetaryUnitsCollectionEnumeratorMock = new Mock>(); + targetLocationPlanetaryUnitsCollectionEnumeratorMock + .Setup(x => x.Current) + .Returns(planetaryUnitMock.Object) + .Callback( + () => + targetLocationPlanetaryUnitsCollectionEnumeratorMock + .Setup(x => x.Current) + .Returns((IUnit)null)); + + var targetLocationPlanetaryUnitsCollectionMock = new Mock>(); + targetLocationPlanetaryUnitsCollectionMock.Setup(x => x.GetEnumerator()).Returns(targetLocationPlanetaryUnitsCollectionEnumeratorMock.Object); + + var pathMock = new Mock(); + pathMock.Setup(x => x.Cost.BronzeCoins).Returns(10); + pathMock.Setup(x => x.Cost.SilverCoins).Returns(10); + pathMock.Setup(x => x.Cost.GoldCoins).Returns(10); + pathMock.Setup(x => x.TargetLocation.Planet.Name).Returns(planetName); + pathMock.Setup(x => x.TargetLocation.Planet.Galaxy.Name).Returns(galaxyName); + pathMock.Setup(x => x.TargetLocation.Planet.Units).Returns(targetLocationPlanetaryUnitsCollectionMock.Object); + + var currentUnitLocationPlanetaryUnitsCollectionEnumeratorMock = new Mock>(); + currentUnitLocationPlanetaryUnitsCollectionEnumeratorMock + .Setup(x => x.Current) + .Returns(unitToTeleportMock.Object) + .Callback( + () => + currentUnitLocationPlanetaryUnitsCollectionEnumeratorMock + .Setup(x => x.Current) + .Returns((IUnit)null)); + + var currentUnitLocationPlanetaryUnitsCollectionMock = new Mock>(); + currentUnitLocationPlanetaryUnitsCollectionMock.Setup(x => x.GetEnumerator()).Returns(currentUnitLocationPlanetaryUnitsCollectionEnumeratorMock.Object); + + var teleportStationMapMock = new List { pathMock.Object }; + var teleportStation = new ExtendedTeleportStation(teleportStationOwnerMock.Object, teleportStationMapMock, teleportStationLocationMock.Object); + var initialTeleportStationResources = teleportStation.Resources.Clone(); + + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Name).Returns(planetName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Galaxy.Name).Returns(galaxyName); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Latitude).Returns(latitude); + unitToTeleportMock.Setup(x => x.CurrentLocation.Coordinates.Longtitude).Returns(longtitude); + unitToTeleportMock.Setup(x => x.CanPay(It.IsAny())).Returns(true); + unitToTeleportMock.Setup(x => x.Pay(pathMock.Object.Cost)).Returns(pathMock.Object.Cost); + unitToTeleportMock.Setup(x => x.CurrentLocation.Planet.Units).Returns(currentUnitLocationPlanetaryUnitsCollectionMock.Object); + + targetLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + targetLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + targetLocationMock.Setup(x => x.Coordinates.Latitude).Returns(latitude); + targetLocationMock.Setup(x => x.Coordinates.Longtitude).Returns(longtitude); + + teleportStationLocationMock.Setup(x => x.Planet.Name).Returns(planetName); + teleportStationLocationMock.Setup(x => x.Planet.Galaxy.Name).Returns(galaxyName); + + // Act + teleportStation.TeleportUnit(unitToTeleportMock.Object, targetLocationMock.Object); + + // Assert + currentUnitLocationPlanetaryUnitsCollectionMock.Verify(x => x.Remove(unitToTeleportMock.Object), Times.Once()); + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/Unit/Pay_Should.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/Unit/Pay_Should.cs new file mode 100644 index 0000000..b24cbb0 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/Unit/Pay_Should.cs @@ -0,0 +1,81 @@ +using System; +using IntergalacticTravel.Contracts; +using Moq; +using NUnit.Framework; + +namespace IntergalacticTravel.Tests.Unit +{ + [TestFixture] + public class Pay_Should + { + [Test] + public void ThrowNullReferenceException_WhenTheObjectPassedIsNull() + { + // Arrange + var unitId = 4124; + var unitName = "Mecho"; + var unit = new IntergalacticTravel.Unit(unitId, unitName); + + // Act & Assert + Assert.Throws(() => unit.Pay((IResources)null)); + } + + [Test] + public void DecreaseTheOwnerResourcesByTheAmountOfTheCost_WhenTheCostObjectIsNotNull() + { + // Arrange + var unitId = 4124; + var unitName = "Mecho"; + var unit = new IntergalacticTravel.Unit(unitId, unitName); + + var costMock = new Mock(); + costMock.Setup(x => x.BronzeCoins).Returns(10); + costMock.Setup(x => x.SilverCoins).Returns(20); + costMock.Setup(x => x.GoldCoins).Returns(30); + + unit.Resources.Add(costMock.Object); + unit.Resources.Add(costMock.Object); + + var expectedBronzeCoins = unit.Resources.BronzeCoins - costMock.Object.BronzeCoins; + var expectedSilverCoins = unit.Resources.SilverCoins - costMock.Object.SilverCoins; + var expectedGoldCoins = unit.Resources.GoldCoins - costMock.Object.GoldCoins; + + // Act + unit.Pay(costMock.Object); + var actualBronzeCoins = unit.Resources.BronzeCoins; + var actualSilverCoins = unit.Resources.SilverCoins; + var actualGoldCoins = unit.Resources.GoldCoins; + + // Assert + Assert.AreEqual(expectedBronzeCoins, actualBronzeCoins); + Assert.AreEqual(expectedSilverCoins, actualSilverCoins); + Assert.AreEqual(expectedGoldCoins, actualGoldCoins); + } + + [Test] + public void ReturnNewResourcesObjectContainingTheSameAmountOfCoinsLikeTheCostObject_WhenTheCostObjectIsNotNullAndTheUnitHasTheRequiredAmountOfResourcesForPayment() + { + // Arrange + var unitId = 4124; + var unitName = "Mecho"; + var unit = new IntergalacticTravel.Unit(unitId, unitName); + + var costMock = new Mock(); + costMock.Setup(x => x.BronzeCoins).Returns(10); + costMock.Setup(x => x.SilverCoins).Returns(20); + costMock.Setup(x => x.GoldCoins).Returns(30); + + var expectedBronzeCoins = costMock.Object.BronzeCoins; + var expectedSilverCoins = costMock.Object.SilverCoins; + var expectedGoldCoins = costMock.Object.GoldCoins; + + // Act + var actualResources = unit.Pay(costMock.Object); + + // Assert + Assert.AreEqual(expectedBronzeCoins, actualResources.BronzeCoins); + Assert.AreEqual(expectedSilverCoins, actualResources.SilverCoins); + Assert.AreEqual(expectedGoldCoins, actualResources.GoldCoins); + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/UnitsFactory/GetUnit_Should.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/UnitsFactory/GetUnit_Should.cs new file mode 100644 index 0000000..411e877 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/UnitsFactory/GetUnit_Should.cs @@ -0,0 +1,62 @@ +using IntergalacticTravel.Exceptions; +using NUnit.Framework; + +namespace IntergalacticTravel.Tests.UnitsFactory +{ + [TestFixture] + public class GetUnit_Should + { + [Test] + public void ReturnNewProcyon_WhenValidCommandIsPassed() + { + // Arrange + var command = "create unit Procyon Gosho 1"; + var unitsFactory = new IntergalacticTravel.UnitsFactory(); + + // Act + var actualUnit = unitsFactory.GetUnit(command); + + // Assert + Assert.IsInstanceOf(actualUnit); + } + + [Test] + public void ReturnNewLuyten_WhenValidCommandIsPassed() + { + // Arrange + var command = "create unit Luyten Pesho 2"; + var unitsFactory = new IntergalacticTravel.UnitsFactory(); + + // Act + var actualUnit = unitsFactory.GetUnit(command); + + // Assert + Assert.IsInstanceOf(actualUnit); + } + + [Test] + public void ReturnNewLacaille_WhenValidCommandIsPassed() + { + // Arrange + var command = "create unit Lacaille Tosho 3"; + var unitsFactory = new IntergalacticTravel.UnitsFactory(); + + // Act + var actualUnit = unitsFactory.GetUnit(command); + + // Assert + Assert.IsInstanceOf(actualUnit); + } + + [TestCase("create unit InvalidType Name 1")] + [TestCase("create unit Luyten Name InvalidId")] + public void ThrowInvalidUnitCreationCommandException_WhenTheCommandPassedIsNotInTheValidFormat(string invalidCommand) + { + // Arrange + var unitsFactory = new IntergalacticTravel.UnitsFactory(); + + // Act & Assert + Assert.Throws(() => unitsFactory.GetUnit(invalidCommand)); + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/packages.config b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/packages.config new file mode 100644 index 0000000..5a6112b --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel.Tests/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel.sln b/Topics/07. Exam (Author solution)/IntergalacticTravel.sln new file mode 100644 index 0000000..97bf583 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntergalacticTravel", "IntergalacticTravel\IntergalacticTravel.csproj", "{ADCEB8BC-59F3-4087-8A14-2EA6FE723F78}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntergalacticTravel.Tests", "IntergalacticTravel.Tests\IntergalacticTravel.Tests.csproj", "{2EC3F83D-ADA2-4124-9400-3C03CFE77BF9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ADCEB8BC-59F3-4087-8A14-2EA6FE723F78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ADCEB8BC-59F3-4087-8A14-2EA6FE723F78}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ADCEB8BC-59F3-4087-8A14-2EA6FE723F78}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ADCEB8BC-59F3-4087-8A14-2EA6FE723F78}.Release|Any CPU.Build.0 = Release|Any CPU + {2EC3F83D-ADA2-4124-9400-3C03CFE77BF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2EC3F83D-ADA2-4124-9400-3C03CFE77BF9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2EC3F83D-ADA2-4124-9400-3C03CFE77BF9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2EC3F83D-ADA2-4124-9400-3C03CFE77BF9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/BusinessOwner.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/BusinessOwner.cs new file mode 100644 index 0000000..389b10b --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/BusinessOwner.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using IntergalacticTravel.Contracts; + +namespace IntergalacticTravel +{ + internal class BusinessOwner : Unit, IBusinessOwner + { + private readonly ICollection teleportStations; + + public BusinessOwner(int identificationNumber, string nickName, IEnumerable teleportStations) : base(identificationNumber, nickName) + { + this.teleportStations = (ICollection)teleportStations; + } + + public ICollection TeleportStations + { + get + { + return this.teleportStations; + } + } + + public void CollectProfits() + { + foreach(var teleportStation in this.teleportStations) + { + var profit = teleportStation.PayProfits(this); + this.Resources.Add(profit); + } + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Constants/GlobalConstants.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Constants/GlobalConstants.cs new file mode 100644 index 0000000..492767a --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Constants/GlobalConstants.cs @@ -0,0 +1,9 @@ +namespace IntergalacticTravel.Constants +{ + public class GlobalConstants + { + public const uint BronzeCoinsDefaultAmount = 0; + public const uint SilverCoinsDefaultAmount = 0; + public const uint GoldCoinsDefaultAmount = 0; + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IBusinessOwner.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IBusinessOwner.cs new file mode 100644 index 0000000..0f1f8de --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IBusinessOwner.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace IntergalacticTravel.Contracts +{ + public interface IBusinessOwner : IUnit + { + ICollection TeleportStations { get; } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IGPSCoordinates.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IGPSCoordinates.cs new file mode 100644 index 0000000..058a18e --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IGPSCoordinates.cs @@ -0,0 +1,12 @@ +namespace IntergalacticTravel.Contracts +{ + /// + /// Represents the Global Positioning System Coordinates + /// + public interface IGPSCoordinates + { + double Longtitude { get; } + + double Latitude { get; } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IGalaxy.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IGalaxy.cs new file mode 100644 index 0000000..7fc8fc6 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IGalaxy.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace IntergalacticTravel.Contracts +{ + public interface IGalaxy : INameable + { + ICollection Planets { get; } + } +} \ No newline at end of file diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/ILocation.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/ILocation.cs new file mode 100644 index 0000000..cd97d1b --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/ILocation.cs @@ -0,0 +1,9 @@ +namespace IntergalacticTravel.Contracts +{ + public interface ILocation + { + IPlanet Planet { get; } + + IGPSCoordinates Coordinates { get; } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/INameable.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/INameable.cs new file mode 100644 index 0000000..58b921a --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/INameable.cs @@ -0,0 +1,7 @@ +namespace IntergalacticTravel.Contracts +{ + public interface INameable + { + string Name { get; } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IPath.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IPath.cs new file mode 100644 index 0000000..abfe643 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IPath.cs @@ -0,0 +1,9 @@ +namespace IntergalacticTravel.Contracts +{ + public interface IPath + { + ILocation TargetLocation { get; } + + IResources Cost { get; } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IPlanet.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IPlanet.cs new file mode 100644 index 0000000..aec72b3 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IPlanet.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace IntergalacticTravel.Contracts +{ + public interface IPlanet : INameable + { + IGalaxy Galaxy { get; } + + ICollection Units { get; } + } +} \ No newline at end of file diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IResources.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IResources.cs new file mode 100644 index 0000000..a81198f --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IResources.cs @@ -0,0 +1,19 @@ +namespace IntergalacticTravel.Contracts +{ + public interface IResources + { + uint GoldCoins { get; set; } + + uint SilverCoins { get; set; } + + uint BronzeCoins { get; set; } + + void Add(IResources payment); + + bool IsEqualTo(IResources resource); + + void Clear(); + + IResources Clone(); + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IResourcesFactory.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IResourcesFactory.cs new file mode 100644 index 0000000..9e340a8 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IResourcesFactory.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IntergalacticTravel.Contracts +{ + public interface IResourcesFactory + { + IResources GetResources(string command); + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/ITeleportStation.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/ITeleportStation.cs new file mode 100644 index 0000000..12e167e --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/ITeleportStation.cs @@ -0,0 +1,9 @@ +namespace IntergalacticTravel.Contracts +{ + public interface ITeleportStation + { + void TeleportUnit(IUnit unitToTeleport, ILocation targetLocation); + + IResources PayProfits(IBusinessOwner owner); + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IUnit.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IUnit.cs new file mode 100644 index 0000000..3e1925e --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Contracts/IUnit.cs @@ -0,0 +1,19 @@ +namespace IntergalacticTravel.Contracts +{ + public interface IUnit + { + int IdentificationNumber { get; } + + string NickName { get; } + + IResources Resources { get; } + + ILocation CurrentLocation { get; set; } + + ILocation PreviousLocation { get; set; } + + bool CanPay(IResources cost); + + IResources Pay(IResources cost); + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/InsufficientResourcesException.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/InsufficientResourcesException.cs new file mode 100644 index 0000000..ae7d373 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/InsufficientResourcesException.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.Serialization; + +namespace IntergalacticTravel.Exceptions +{ + public class InsufficientResourcesException : Exception + { + public InsufficientResourcesException() + { + } + + public InsufficientResourcesException(string message) : base(message) + { + } + + public InsufficientResourcesException(string message, Exception innerException) : base(message, innerException) + { + } + + protected InsufficientResourcesException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/InvalidTeleportationLocationException.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/InvalidTeleportationLocationException.cs new file mode 100644 index 0000000..f0bf4c4 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/InvalidTeleportationLocationException.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.Serialization; + +namespace IntergalacticTravel.Exceptions +{ + public class InvalidTeleportationLocationException : Exception + { + public InvalidTeleportationLocationException() + { + } + + public InvalidTeleportationLocationException(string message) : base(message) + { + } + + public InvalidTeleportationLocationException(string message, Exception innerException) : base(message, innerException) + { + } + + protected InvalidTeleportationLocationException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/InvalidUnitCreationCommandException.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/InvalidUnitCreationCommandException.cs new file mode 100644 index 0000000..0a3a586 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/InvalidUnitCreationCommandException.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.Serialization; + +namespace IntergalacticTravel.Exceptions +{ + public class InvalidUnitCreationCommandException : Exception + { + public InvalidUnitCreationCommandException() + { + } + + public InvalidUnitCreationCommandException(string message) : base(message) + { + } + + public InvalidUnitCreationCommandException(string message, Exception innerException) : base(message, innerException) + { + } + + protected InvalidUnitCreationCommandException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/LocationNotFoundException.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/LocationNotFoundException.cs new file mode 100644 index 0000000..5ece743 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/LocationNotFoundException.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.Serialization; + +namespace IntergalacticTravel.Exceptions +{ + public class LocationNotFoundException : Exception + { + public LocationNotFoundException() + { + } + + public LocationNotFoundException(string message) : base(message) + { + } + + public LocationNotFoundException(string message, Exception innerException) : base(message, innerException) + { + } + + protected LocationNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/TeleportOutOfRangeException.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/TeleportOutOfRangeException.cs new file mode 100644 index 0000000..62f8180 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Exceptions/TeleportOutOfRangeException.cs @@ -0,0 +1,32 @@ +using System; +using System.Runtime.Serialization; + +namespace IntergalacticTravel.Exceptions +{ + public class TeleportOutOfRangeException : ArgumentOutOfRangeException + { + public TeleportOutOfRangeException() + { + } + + public TeleportOutOfRangeException(string paramName) : base(paramName) + { + } + + public TeleportOutOfRangeException(string message, Exception innerException) : base(message, innerException) + { + } + + public TeleportOutOfRangeException(string paramName, string message) : base(paramName, message) + { + } + + public TeleportOutOfRangeException(string paramName, object actualValue, string message) : base(paramName, actualValue, message) + { + } + + protected TeleportOutOfRangeException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/ExtendedTeleportStation.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/ExtendedTeleportStation.cs new file mode 100644 index 0000000..fe7c9b0 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/ExtendedTeleportStation.cs @@ -0,0 +1,45 @@ +using System.Collections.Generic; +using IntergalacticTravel.Contracts; + +namespace IntergalacticTravel +{ + public class ExtendedTeleportStation : TeleportStation + { + public ExtendedTeleportStation(IBusinessOwner owner, IEnumerable galacticMap, ILocation location) + : base(owner, galacticMap, location) + { + } + + public IBusinessOwner Owner + { + get + { + return this.owner; + } + } + + public ILocation Location + { + get + { + return this.location; + } + } + + public IEnumerable GalacticMap + { + get + { + return this.galacticMap; + } + } + + public IResources Resources + { + get + { + return this.resources; + } + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Extensions/IEnumerableExtensions.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Extensions/IEnumerableExtensions.cs new file mode 100644 index 0000000..1433c4d --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Extensions/IEnumerableExtensions.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using System.Linq; + +namespace IntergalacticTravel.Extensions +{ + public static class IEnumerableExtensions + { + public static bool IsNullOrEmpty(this IEnumerable enumeration) + { + return enumeration == null || + enumeration.Count() == 0; + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Extensions/ObjectExtensions.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Extensions/ObjectExtensions.cs new file mode 100644 index 0000000..2d0d79d --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Extensions/ObjectExtensions.cs @@ -0,0 +1,15 @@ +namespace IntergalacticTravel.Extensions +{ + public static class ObjectExtensions + { + public static bool IsNull(this object obj) + { + return obj == null; + } + + public static bool IsNotNull(this object obj) + { + return obj != null; + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/IntergalacticTravel.csproj b/Topics/07. Exam (Author solution)/IntergalacticTravel/IntergalacticTravel.csproj new file mode 100644 index 0000000..44cca17 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/IntergalacticTravel.csproj @@ -0,0 +1,84 @@ + + + + + Debug + AnyCPU + {ADCEB8BC-59F3-4087-8A14-2EA6FE723F78} + Library + Properties + IntergalacticTravel + IntergalacticTravel + v4.5.2 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Lacaille.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Lacaille.cs new file mode 100644 index 0000000..b254f32 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Lacaille.cs @@ -0,0 +1,12 @@ +namespace IntergalacticTravel +{ + /// + /// Imma dummy class + /// + internal class Lacaille : Unit + { + public Lacaille(int identificationNumber, string nickName) : base(identificationNumber, nickName) + { + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Luyten.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Luyten.cs new file mode 100644 index 0000000..f096643 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Luyten.cs @@ -0,0 +1,12 @@ +namespace IntergalacticTravel +{ + /// + /// Imma dummy class + /// + internal class Luyten : Unit + { + public Luyten(int identificationNumber, string nickName) : base(identificationNumber, nickName) + { + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Procyon.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Procyon.cs new file mode 100644 index 0000000..8b7e0de --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Procyon.cs @@ -0,0 +1,12 @@ +namespace IntergalacticTravel +{ + /// + /// Imma dummy class + /// + internal class Procyon : Unit + { + public Procyon(int identificationNumber, string nickName) : base(identificationNumber, nickName) + { + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Properties/AssemblyInfo.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..fbfa881 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Properties/AssemblyInfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IntergalacticTravel")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("IntergalacticTravel")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("adceb8bc-59f3-4087-8a14-2ea6fe723f78")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + +[assembly: InternalsVisibleTo("IntergalacticTravel.Tests")] +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Resources.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Resources.cs new file mode 100644 index 0000000..4718a6d --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Resources.cs @@ -0,0 +1,99 @@ +using System; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; +using IntergalacticTravel.Constants; +using IntergalacticTravel.Contracts; + +namespace IntergalacticTravel +{ + [Serializable] + public class Resources : IResources + { + private uint bronzeCoins; + private uint silverCoins; + private uint goldCoins; + + public Resources() + : this(GlobalConstants.BronzeCoinsDefaultAmount, + GlobalConstants.SilverCoinsDefaultAmount, + GlobalConstants.GoldCoinsDefaultAmount) + { + } + + public Resources(uint bronzeCoins, uint silverCoins, uint goldCoins) + { + this.bronzeCoins = bronzeCoins; + this.silverCoins = silverCoins; + this.goldCoins = goldCoins; + } + + public uint BronzeCoins + { + get + { + return this.bronzeCoins; + } + set + { + this.bronzeCoins = value; + } + } + + public uint GoldCoins + { + get + { + return this.goldCoins; + } + set + { + this.goldCoins = value; + } + } + + public uint SilverCoins + { + get + { + return this.silverCoins; + } + set + { + this.silverCoins = value; + } + } + + public void Add(IResources payment) + { + this.bronzeCoins += payment.BronzeCoins; + this.silverCoins += payment.SilverCoins; + this.goldCoins += payment.GoldCoins; + } + + public bool IsEqualTo(IResources resource) + { + return resource.GoldCoins == this.goldCoins && + resource.SilverCoins == this.silverCoins && + resource.BronzeCoins == this.bronzeCoins; + } + + public void Clear() + { + this.bronzeCoins = 0; + this.silverCoins = 0; + this.goldCoins = 0; + } + + public IResources Clone() + { + using (var stream = new MemoryStream()) + { + var formatter = new BinaryFormatter(); + formatter.Serialize(stream, this); + stream.Seek(0, SeekOrigin.Begin); + + return (IResources)formatter.Deserialize(stream); + } + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/ResourcesFactory.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/ResourcesFactory.cs new file mode 100644 index 0000000..d5ca9e0 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/ResourcesFactory.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using IntergalacticTravel.Contracts; + +namespace IntergalacticTravel +{ + public class ResourcesFactory : IResourcesFactory + { + private const int FirstLetterIndex = 0; + private const int ResourceAmountIndex = 1; + private const int ResourcesParametersStartIndex = 2; + private const char BronzeKey = 'b'; + private const char SilverKey = 's'; + private const char GoldKey = 'g'; + private const char OpeningBracket = '('; + private const char ClosingBracket = ')'; + + private readonly IDictionary resourcesParameters; + + public ResourcesFactory() + { + this.resourcesParameters = new Dictionary(); + } + + public IResources GetResources(string command) + { + try + { + this.BuildResourcesParametersDictionary(command); + + return new Resources( + this.resourcesParameters[BronzeKey], + this.resourcesParameters[SilverKey], + this.resourcesParameters[GoldKey]); + } + catch (Exception exc) + { + if (exc.GetType() == typeof(OverflowException)) + { + throw new OverflowException(); + } + + throw new InvalidOperationException("Invalid command"); + } + } + + private void BuildResourcesParametersDictionary(string command) + { + var commandParams = command.Split(' '); + + for (int i = ResourcesParametersStartIndex; i < commandParams.Length; i++) + { + var resourceType = commandParams[i]; + var key = resourceType[FirstLetterIndex]; + var paramz = resourceType.Split( + new char[] { OpeningBracket, ClosingBracket }, + StringSplitOptions.RemoveEmptyEntries); + + var value = uint.Parse(paramz[ResourceAmountIndex]); + + this.resourcesParameters[key] = value; + } + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/TeleportStation.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/TeleportStation.cs new file mode 100644 index 0000000..49db271 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/TeleportStation.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using IntergalacticTravel.Contracts; +using IntergalacticTravel.Exceptions; +using IntergalacticTravel.Extensions; + +namespace IntergalacticTravel +{ + public class TeleportStation : ITeleportStation + { + protected readonly IResources resources; + protected readonly IBusinessOwner owner; + protected readonly ILocation location; + protected readonly IEnumerable galacticMap; + + public TeleportStation(IBusinessOwner owner, IEnumerable galacticMap, ILocation location) + { + this.owner = owner; + this.galacticMap = galacticMap; + this.location = location; + this.resources = new Resources(); + } + + public void TeleportUnit(IUnit unitToTeleport, ILocation targetLocation) + { + IPath pathToTheTargetPlanet; + + this.ValidateThatTeleportationServiceIsApplicable(unitToTeleport, targetLocation, out pathToTheTargetPlanet); + + this.GetPayment(pathToTheTargetPlanet, unitToTeleport); + + this.ChangeUnitLocation(pathToTheTargetPlanet, unitToTeleport, targetLocation); + } + + public IResources PayProfits(IBusinessOwner owner) + { + if (this.owner.IdentificationNumber != owner.IdentificationNumber) + { + throw new UnauthorizedAccessException("Payments are allowed only to the owner"); + } + + var payment = this.resources.Clone(); + this.resources.Clear(); + + return payment; + } + + private void ChangeUnitLocation(IPath pathToTheTargetPlanet, IUnit unitToTeleport, ILocation targetLocation) + { + pathToTheTargetPlanet.TargetLocation.Planet.Units.Add(unitToTeleport); + unitToTeleport.CurrentLocation.Planet.Units.Remove(unitToTeleport); + unitToTeleport.PreviousLocation = unitToTeleport.CurrentLocation; + unitToTeleport.CurrentLocation = targetLocation; + } + + private void GetPayment(IPath pathToTheTargetPlanet, IUnit unitToTeleport) + { + var cost = pathToTheTargetPlanet.Cost; + var payment = unitToTeleport.Pay(cost); + this.resources.Add(payment); + } + + private bool LocationsMatch(ILocation firstLocation, ILocation secondLocation) + { + return firstLocation.Planet.Galaxy.Name == secondLocation.Planet.Galaxy.Name && + firstLocation.Planet.Name == secondLocation.Planet.Name; + } + + private bool LocationsAndCoordinatesMatch(ILocation firstLocation, ILocation secondLocation) + { + return firstLocation.Coordinates.Latitude == secondLocation.Coordinates.Latitude && + firstLocation.Coordinates.Longtitude == secondLocation.Coordinates.Longtitude && + this.LocationsMatch(firstLocation, secondLocation); + } + + private void ValidateThatTeleportationServiceIsApplicable(IUnit unitToTeleport, ILocation targetLocation, out IPath pathToTheTargetPlanet) + { + if (unitToTeleport.IsNull()) + { + throw new ArgumentNullException("unitToTeleport"); + } + + if (targetLocation.IsNull()) + { + throw new ArgumentNullException("destination"); + } + + if (!this.LocationsMatch(this.location, unitToTeleport.CurrentLocation)) + { + throw new TeleportOutOfRangeException("unitToTeleport.CurrentLocation"); + } + + var pathsToTheTargetGalaxy = galacticMap + .Where(path => path.TargetLocation.Planet.Galaxy.Name == targetLocation.Planet.Galaxy.Name) + .ToList(); + if (pathsToTheTargetGalaxy.IsNullOrEmpty()) + { + throw new LocationNotFoundException("A path to a Galaxy with the provided name cannot be found in the TeleportStation's galactic map."); + } + + pathToTheTargetPlanet = pathsToTheTargetGalaxy.FirstOrDefault(path => path.TargetLocation.Planet.Name == targetLocation.Planet.Name); + if (pathToTheTargetPlanet.IsNull()) + { + throw new LocationNotFoundException("A path to a Planet with the provided name cannot be found in the TeleportStation's galactic map."); + } + + foreach (var unitInCity in pathToTheTargetPlanet.TargetLocation.Planet.Units) + { + if (this.LocationsAndCoordinatesMatch(targetLocation, unitInCity.CurrentLocation)) + { + throw new InvalidTeleportationLocationException("There is already a unit placed on the desired location. Cannot activate the teleportation service because the units will overlap."); + } + } + + if (!unitToTeleport.CanPay(pathToTheTargetPlanet.Cost)) + { + throw new InsufficientResourcesException("The unit cannot be teleported, because THERE AIN'T NO SUCH THING AS A FREE LUNCH."); + } + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/TheOneThatRulesThemAll.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/TheOneThatRulesThemAll.cs new file mode 100644 index 0000000..906e0ca --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/TheOneThatRulesThemAll.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IntergalacticTravel +{ + public class TheOneThatRulesThemAll + { + public void RuleThem() + { + + // Create galactic map + + // Create units + + // Give them some resources + + // Set their location + + // Teleport them + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/Unit.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/Unit.cs new file mode 100644 index 0000000..8b7d689 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/Unit.cs @@ -0,0 +1,86 @@ +using IntergalacticTravel.Contracts; + +namespace IntergalacticTravel +{ + internal class Unit : IUnit + { + private ILocation currentLocation; + private ILocation previousLocation; + private readonly int identificationNumber; + private readonly string nickName; + private readonly IResources resources; + + public Unit(int identificationNumber, string nickName) + { + this.identificationNumber = identificationNumber; + this.nickName = nickName; + this.resources = new Resources(); + } + + public ILocation CurrentLocation + { + get + { + return this.currentLocation; + } + + set + { + this.currentLocation = value; + } + } + + public int IdentificationNumber + { + get + { + return this.identificationNumber; + } + } + + public string NickName + { + get + { + return this.nickName; + } + } + + public ILocation PreviousLocation + { + get + { + return this.previousLocation; + } + + set + { + this.previousLocation = value; + } + } + + public IResources Resources + { + get + { + return this.resources; + } + } + + public bool CanPay(IResources cost) + { + return this.resources.GoldCoins >= cost.GoldCoins && + this.resources.SilverCoins >= cost.SilverCoins && + this.resources.BronzeCoins >= cost.BronzeCoins; + } + + public IResources Pay(IResources cost) + { + this.resources.BronzeCoins -= cost.BronzeCoins; + this.resources.SilverCoins -= cost.SilverCoins; + this.resources.GoldCoins -= cost.GoldCoins; + + return new Resources(cost.BronzeCoins, cost.SilverCoins, cost.GoldCoins); + } + } +} diff --git a/Topics/07. Exam (Author solution)/IntergalacticTravel/UnitsFactory.cs b/Topics/07. Exam (Author solution)/IntergalacticTravel/UnitsFactory.cs new file mode 100644 index 0000000..da337c3 --- /dev/null +++ b/Topics/07. Exam (Author solution)/IntergalacticTravel/UnitsFactory.cs @@ -0,0 +1,34 @@ +using System; +using System.Linq; +using System.Reflection; +using IntergalacticTravel.Contracts; +using IntergalacticTravel.Exceptions; + +namespace IntergalacticTravel +{ + public class UnitsFactory + { + private const int UnitTypeIndex = 2; + private const int UnitNameIndex = 3; + private const int UnitIdIndex = 4; + + public IUnit GetUnit(string command) + { + try + { + var commandParams = command.Split(' '); + var unitType = commandParams[UnitTypeIndex]; + var unitName = commandParams[UnitNameIndex]; + var unitId = commandParams[UnitIdIndex]; + + var typeToInstantiate = Assembly.Load("IntergalacticTravel").GetTypes().FirstOrDefault(x => x.Name == unitType); + return (IUnit)Activator.CreateInstance(typeToInstantiate, int.Parse(unitId), unitName); + } + catch (Exception) + { + throw new InvalidUnitCreationCommandException(); + } + + } + } +}