Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMichael North
2,561 PointsTreehouseDefense.MapLocation does not contain a constructor that takes 2 arguments
namespace TreehouseDefense
{
class MapLocation : Point
{
public MapLocation(int x, int y, Map map) : base(x, y)
{
if (!map.OnMap(this))
{
throw new System.Exception();
}
}
}
}
I am getting an error saying TreehouseDefense.MapLocation does not contain a constructor that takes 2 arguments please help.
Michael North
2,561 PointsI think that is how you do it.
2 Answers
Steven Parker
231,269 PointsDid you fix your issue before making the snapshot?
The snapshot is good, but when I built and ran your project I did not get the error you described (or any error).
Michael North
2,561 PointsWow. There was an error a minute ago, thank you anyways. It means a lot that people are out there to help me learn, an answer my questions.
Steven Parker
231,269 PointsSteven Parker
231,269 PointsThe problem doesn't seem to be in that small code snippet above. Try sharing your entire project by making a snapshot of your workspace and post the link to it here.