title: How to define get and set methods
body: <p>Thanks so much, your help is really appreciated. Its made realise how much I have to learn. Its the direction that I want to set and get to have adapted your examples to reflect this. However, its now asking for ; at the end of my static void Main.... even though I have never added this before, its asking to declare the body extern, abstract. Its also not letting me set the links whilst in Main, I am using the following syntax gh.setName("Great Hall"); gh.setN(dr); in order to set the north link between the great hall and the drawing room. Any idea?       </p>
  
  <pre><code>private string RoomName;
          private Room N = null;
          private Room E = null;
          private Room S = null;
          private Room W = null;
  
          public Room X { get; private set; }
  
          public void setName(string N)
          {
              RoomName = N;
          }
  
          public void setN(Room X)
          {
              N = X;
          }
  
          public void setE(Room X)
          {
              E = X;
          }
  
          public void setW(Room X)
          {
              W = X;
          }
  
          public void setS(Room x)
          {
              S = X;
          }
  
  
          public Room getN()
          {
              return N;
          }
  
          public Room getE()
          {
              return E;
          }
  
          public Room getS()
          {
              return S;
          }
  
          public Room getW()
          {
              return W;
          }
  
  
  
  
          static void Main(string[] args)
  
        Room gh = new Room();
          Room kit = new Room();
          Room Pan = new Room();
          Room Dun = new Room();
          Room dr = new Room();
          Room lib = new Room();
          Room din = new Room();
          Room sr = new Room();
          Room weap = new Room();
          Room tow = new Room();
          Room gal = new Room();
          Room tr = new Room();
  
          gh.setName("Great Hall");
              gh.setN(dr);
  </code></pre>