-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
1,208 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using OpenTracker.Interfaces; | ||
using OpenTracker.Models; | ||
|
||
namespace OpenTracker.Actions | ||
{ | ||
public class AddItem : IUndoable | ||
{ | ||
private readonly Item _item; | ||
|
||
public AddItem(Item item) | ||
{ | ||
_item = item; | ||
} | ||
|
||
public void Execute() | ||
{ | ||
_item.Change(1); | ||
} | ||
|
||
public void Undo() | ||
{ | ||
_item.Change(-1); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using OpenTracker.Interfaces; | ||
using OpenTracker.Models; | ||
|
||
namespace OpenTracker.Actions | ||
{ | ||
public class ChangeBoss : IUndoable | ||
{ | ||
private readonly BossSection _bossSection; | ||
private readonly Boss _boss; | ||
private Boss _previousBoss; | ||
|
||
public ChangeBoss(BossSection bossSection, Boss boss) | ||
{ | ||
_bossSection = bossSection; | ||
_boss = boss; | ||
} | ||
|
||
public void Execute() | ||
{ | ||
_previousBoss = _bossSection.Boss; | ||
_bossSection.Boss = _boss; | ||
} | ||
|
||
public void Undo() | ||
{ | ||
_bossSection.Boss = _previousBoss; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using OpenTracker.Interfaces; | ||
using OpenTracker.Models; | ||
|
||
namespace OpenTracker.Actions | ||
{ | ||
public class ChangeBossShuffle : IUndoable | ||
{ | ||
private readonly Mode _mode; | ||
private readonly bool _bossShuffle; | ||
private bool _previousBossShuffle; | ||
|
||
public ChangeBossShuffle(Mode mode, bool bossShuffle) | ||
{ | ||
_mode = mode; | ||
_bossShuffle = bossShuffle; | ||
} | ||
|
||
public void Execute() | ||
{ | ||
_previousBossShuffle = _mode.BossShuffle.Value; | ||
_mode.BossShuffle = _bossShuffle; | ||
} | ||
|
||
public void Undo() | ||
{ | ||
_mode.BossShuffle = _previousBossShuffle; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using OpenTracker.Interfaces; | ||
using OpenTracker.Models; | ||
using OpenTracker.Models.Enums; | ||
|
||
namespace OpenTracker.Actions | ||
{ | ||
public class ChangeDungeonItemShuffle : IUndoable | ||
{ | ||
private readonly Mode _mode; | ||
private readonly DungeonItemShuffle _dungeonItemShuffle; | ||
private DungeonItemShuffle _previousDungeonItemShuffle; | ||
|
||
public ChangeDungeonItemShuffle(Mode mode, DungeonItemShuffle dungeonItemShuffle) | ||
{ | ||
_mode = mode; | ||
_dungeonItemShuffle = dungeonItemShuffle; | ||
} | ||
|
||
public void Execute() | ||
{ | ||
_previousDungeonItemShuffle = _mode.DungeonItemShuffle.Value; | ||
_mode.DungeonItemShuffle = _dungeonItemShuffle; | ||
} | ||
|
||
public void Undo() | ||
{ | ||
_mode.DungeonItemShuffle = _previousDungeonItemShuffle; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using OpenTracker.Interfaces; | ||
using OpenTracker.Models; | ||
|
||
namespace OpenTracker.Actions | ||
{ | ||
public class ChangeEnemyShuffle : IUndoable | ||
{ | ||
private readonly Mode _mode; | ||
private readonly bool _enemyShuffle; | ||
private bool _previousEnemyShuffle; | ||
|
||
public ChangeEnemyShuffle(Mode mode, bool enemyShuffle) | ||
{ | ||
_mode = mode; | ||
_enemyShuffle = enemyShuffle; | ||
} | ||
|
||
public void Execute() | ||
{ | ||
_previousEnemyShuffle = _mode.EnemyShuffle.Value; | ||
_mode.EnemyShuffle = _enemyShuffle; | ||
} | ||
|
||
public void Undo() | ||
{ | ||
_mode.EnemyShuffle = _previousEnemyShuffle; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using OpenTracker.Interfaces; | ||
using OpenTracker.Models; | ||
|
||
namespace OpenTracker.Actions | ||
{ | ||
public class ChangeEntranceShuffle : IUndoable | ||
{ | ||
private readonly Mode _mode; | ||
private readonly bool _entranceShuffle; | ||
private bool _previousEntranceShuffle; | ||
|
||
public ChangeEntranceShuffle(Mode mode, bool entranceShuffle) | ||
{ | ||
_mode = mode; | ||
_entranceShuffle = entranceShuffle; | ||
} | ||
|
||
public void Execute() | ||
{ | ||
_previousEntranceShuffle = _mode.EntranceShuffle.Value; | ||
_mode.EntranceShuffle = _entranceShuffle; | ||
} | ||
|
||
public void Undo() | ||
{ | ||
_mode.EntranceShuffle = _previousEntranceShuffle; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using OpenTracker.Interfaces; | ||
using OpenTracker.Models; | ||
using OpenTracker.Models.Enums; | ||
|
||
namespace OpenTracker.Actions | ||
{ | ||
public class ChangeItemPlacement : IUndoable | ||
{ | ||
private readonly Mode _mode; | ||
private readonly ItemPlacement _itemPlacement; | ||
private ItemPlacement _previousItemPlacement; | ||
|
||
public ChangeItemPlacement(Mode mode, ItemPlacement itemPlacement) | ||
{ | ||
_mode = mode; | ||
_itemPlacement = itemPlacement; | ||
} | ||
|
||
public void Execute() | ||
{ | ||
_previousItemPlacement = _mode.ItemPlacement.Value; | ||
_mode.ItemPlacement = _itemPlacement; | ||
} | ||
|
||
public void Undo() | ||
{ | ||
_mode.ItemPlacement = _previousItemPlacement; | ||
} | ||
|
||
public bool Validate(ItemPlacement itemPlacement) | ||
{ | ||
return _itemPlacement == itemPlacement; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using OpenTracker.Interfaces; | ||
using OpenTracker.Models; | ||
|
||
namespace OpenTracker.Actions | ||
{ | ||
public class ChangePrize : IUndoable | ||
{ | ||
private readonly BossSection _prizeSection; | ||
private readonly Item _item; | ||
private Item _previousItem; | ||
|
||
public ChangePrize(BossSection prizeSection, Item item) | ||
{ | ||
_prizeSection = prizeSection; | ||
_item = item; | ||
} | ||
|
||
public void Execute() | ||
{ | ||
_previousItem = _prizeSection.Prize; | ||
_prizeSection.Prize = _item; | ||
} | ||
|
||
public void Undo() | ||
{ | ||
_prizeSection.Prize = _previousItem; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using OpenTracker.Interfaces; | ||
using OpenTracker.Models; | ||
using OpenTracker.Models.Enums; | ||
|
||
namespace OpenTracker.Actions | ||
{ | ||
public class ChangeWorldState : IUndoable | ||
{ | ||
private readonly Mode _mode; | ||
private readonly WorldState _worldState; | ||
private WorldState _previousWorldState; | ||
|
||
public ChangeWorldState(Mode mode, WorldState worldState) | ||
{ | ||
_mode = mode; | ||
_worldState = worldState; | ||
} | ||
|
||
public void Execute() | ||
{ | ||
_previousWorldState = _mode.WorldState.Value; | ||
_mode.WorldState = _worldState; | ||
} | ||
|
||
public void Undo() | ||
{ | ||
_mode.WorldState = _previousWorldState; | ||
} | ||
} | ||
} |
Oops, something went wrong.