title: C# how to properly code reusable classes?
body: <p>I want to be able to call methods from a GameState object, like this:</p>
  <pre><code>public void some_method (GameState s)
  {
    GameState s_copy = s.duplicate()
    s_copy.make_move()
    //s_copy now has made a move, but s remains untouched.
  }
  </code></pre>
  <p>So the class GameState should have:</p>
  <p>-The make_move method.</p>
  <p>-The duplicate method. Duplicate is used to create a deepcopy of the object, so that I can make moves in a GameState without altering the original one.</p>
  <p>Which makes me believe I need to create an interface, because I can have multiple games. Here is where I am confused. I'm currently trying:</p>
  <pre><code>public interface IGameState
  {
    void make_move();
    GameState duplicate();
  }
  public class GameState : IGameState
  {
    public virtual void make_move(){}
    public virtual GameState duplicate(){}
  }
  public class Game1 : GameState
  {
    public override void make_move(){ /*whatever a move is in game 1*/}
    public GameState override duplicate() { /*deepcopy of the class variables*/ }
  }
  public class Game2 : GameState
  {
    public void make_move(){ /*whatever a move is in game 2*/}
    GameState duplicate() { /*deepcopy of the class variables*/ }
  }
  </code></pre>
  <p>So, when I call &quot;some_method&quot;, I expect to be able to pass any of the game objects:</p>
  <pre><code>g1 = new Game1();
  g2 = new Game2();
  some_method((GameState)g1);
  some_method((GameState)g2);
  </code></pre>
  <p>But I seem to be unable to access the methods, and the duplicate() GameState typing is creating a mess when the newly created GameState is used.
  I've read about generic types, static, abstract classes and interfaces, but cannot wrap my head around how this is supposed to be done, and feels wrong so far.</p>
  <p>Edit: Game1 and Game2 are completely different games: othello and tictactoe let's say</p>