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
Martinho Fernandes
committed
Feb 6, 2014
1 parent
6f31fd4
commit c1000e2
Showing
7 changed files
with
85 additions
and
27 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
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 |
---|---|---|
@@ -1,9 +1,55 @@ | ||
namespace Dagon | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Dagon | ||
{ | ||
public class Game | ||
{ | ||
public Game() | ||
{ | ||
State = new GameState(); | ||
} | ||
|
||
public Player Player { get; set; } | ||
|
||
public Game Previous { get; set; } | ||
public GameState State { get; set; } | ||
|
||
private void StartAction() | ||
{ | ||
State = State.Clone(); | ||
} | ||
} | ||
|
||
public class GameState | ||
{ | ||
public Dungeon Dungeon { get; set; } | ||
public IList<Monster> Monsters { get; set; } | ||
|
||
public GameState Previous { get; set; } | ||
|
||
public GameState Clone() | ||
{ | ||
return new GameState | ||
{ | ||
Dungeon = Dungeon.Clone(), | ||
Monsters = Monsters.Select(m => m.Clone()).ToList(), | ||
Previous = this, | ||
}; | ||
} | ||
} | ||
|
||
public class Monster : IDrawable | ||
{ | ||
public Point Position { get; set; } | ||
|
||
public void Draw(Window window) | ||
{ | ||
window.Set(Position, 'X'); | ||
} | ||
|
||
public Monster Clone() | ||
{ | ||
return new Monster {Position = Position}; | ||
} | ||
} | ||
} |
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,7 @@ | ||
namespace Dagon | ||
{ | ||
public interface IDrawable | ||
{ | ||
void Draw(Window window); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
Standard fare roguelike with a time travelling mechanic. Single player, randomly-generated content, no saving. | ||
Clone of robots. | ||
|
||
All previous state information is saved except for player information. | ||
|
||
The player has a time travelling ability that I won't bother balancing because fun. Said ability allows the player to move back into any previous state. | ||
The player has a time travelling ability that I won't bother balancing because fun. | ||
Said ability allows the player to move back into any previous state. | ||
|
||
If enough time left, forked timestreams? |
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