Jump to content
  • Advertisement
Sign in to follow this  
Froggggy

Quick Question

This topic is 2531 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Why doesn't this compile? Early morning, sorry for the stupidity.

Disregard this. I've figured it out. I've overworked my brain for today.



public class Calculations : Entity
{
public void DamageGenerator(Entity hero)
{
}
}

public class Battle
{
public Battle(Entity hero)
{
Calculations damGen = new Calculations(hero);
}
}

Share this post


Link to post
Share on other sites
Advertisement

Where is the constructor of Calculations class that takes instance of Entity as argument?


That's basically what I asked myself which led to me answering my own question. Like I said, early morning. I kind of preemptively posted.

Share this post


Link to post
Share on other sites
The Calculations class does not have a constructor that takes an Entity as argument, actually it has no constructors at all except for the default generated one.

Compilers usually give you pretty detailed error messages. Posting that output along with the code makes it a lot easier for others to find the error especially if it's not as obvious as in this case.

Edit: Wow not only too slow to give the response, but also slower than the answer to that response.... it was close though ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!