Hey i have this so far as a little Dos text game Code: namespace AutoBattle { public class Start { static void Main() { Fighting.battlemethod(); } } } and another class namespace AutoBattle { class Fighting { public static void battlemethod(string hero, string Monster, int Damage) { Console.WriteLine("What is the hero's name"); hero = Console.ReadLine(); Console.WriteLine("What is the Monsters name?"); Monster = Console.ReadLine(); Console.Write("{0} is facing a {1}", hero, Monster); } } } In main the Fighting.Battlemethod is highlighted and the error reads No overload for method "battlemethod" takes '0' arguments. how do i fix this?
Give Fighting.battlemethod() some arguments, e.g. Code: Fighting.battlemethod("xpi0t0s","whitfox",MAXINT); C# uses function overloading, which means you can have multiple functions named battlemethod(), but they must have different argument lists, for example you could have the battlemethod defined above for a player, a monster and damage points; you could also have one for traps where a player just gets hit with a number of points, you can have one with no agruments at all that does whatever seems appropriate etc. So the other possibility is to define Fighting::battlemethod(/*no arguments*/).