carlAlex
8/10/2016 - 10:26 AM

C# inheritance

C# inheritance

namespace TreehouseDefense
{
  class Point
  {
    int XPos;
    int YPos;
    
    public Point(int x, inty)
    {
      XPos = x;
      YPos = y;
    }
  }
}

namespace TreehouseDefense
{
  class MapLocation : Point
  {
    public MapLocation(int x, int y) : base(x, y)
    {
      
    }
  }
}

typeCheck
x is MapLocation