I'm trying to teach myself C#, however, in a console application that lets users build a character in an RPG I'm trying to make I am beyond stuck. Coding is in the spoiler below.
Can anyone offer assistance?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class MakeACharacter
{
public static void Main()
{
Character c1 = new Character();
c1.Name = "Ralph";
c1.Race = "Human";
c1.Classes = "Hunter";
Console.WriteLine("Ralph, Human, Hunter", "Name, Race, Classes");
Display(c1);
}
public static void Display(Character c1);
{
Console.WriteLine("Ralph, Human, Hunter", "Name, Race, Classes");
}
}
public class Character
{//start character class
//Fields
string name, race, classes;
int intellect, strength, agility, cunning, stealth;
//constructor
public Character(string x,string y,string z)
{
Name = x;
Race = y;
Classes = z;
}
public string Name
{//start name prop
get
{
return name;
}
set
{
name = value;
}
}//end name prop
public string Race
{//start race prop
get
{
return race;
}
set
{
race = value;
}
}//end name prop
public string Classes
{//start classes prop
get
{
return classes;
}
set
{
classes = value;
if (classes == "Hunter" && race == "Human")
intellect = 40;
strength = 35;
agility = 30;
cunning = 40;
stealth = 30;
if (classes == "Warrior" && race == "Human")
intellect = 40;
strength = 35;
agility = 40;
cunning = 40;
stealth = 20;
if (classes == "Cleric" && race == "Human")
intellect = 55;
strength = 30;
agility = 30;
cunning = 45;
stealth = 15;
if (classes == "Hunter" && race == "Dwarf")
intellect = 30;
strength = 70;
agility = 35;
cunning = 15;
stealth = 25;
if (classes == "Warrior" && race == "Dwarf")
intellect = 30;
strength = 60;
agility = 55;
cunning = 20;
stealth = 10;
if (classes == "Cleric" && race == "Dwarf")
intellect = 45;
strength = 70;
agility = 35;
cunning = 25;
stealth = 0;
if (classes == "Hunter" && race == "Elf")
intellect = 35;
strength = 30;
agility = 45;
cunning = 25;
stealth = 40;
if (classes == "Warrior" && race == "Elf")
intellect = 35;
strength = 20;
agility = 45;
cunning = 35;
stealth = 40;
if (classes == "Cleric" && race == "Elf")
intellect = 55;
strength = 15;
agility = 45;
cunning = 20;
stealth = 40;
}
}
public int Intellect
{//start intellect prop
get
{
return intellect;
}
}//end intellect prop
public int Strength
{//start strength prop
get
{
return strength;
}
}//end strength prop
public int Agility
{//start agility prop
get
{
return agility;
}
}//end agility prop
public int Cunning
{//start cunning prop
get
{
return cunning;
}
}//end cunning prop
public int Stealth
{//start stealth prop
get
{
return stealth;
}
}//end stealth prop
public void Output()
{
Console.WriteLine (Name);
Console.WriteLine (Race);
Console.WriteLine (Classes);
Console.WriteLine(Intellect);
Console.WriteLine (Strength);
Console.WriteLine (Agility);
Console.WriteLine (Cunning);
Console.WriteLine (Stealth);
}
}//end character
using System.Collections.Generic;
using System.Linq;
using System.Text;
class MakeACharacter
{
public static void Main()
{
Character c1 = new Character();
c1.Name = "Ralph";
c1.Race = "Human";
c1.Classes = "Hunter";
Console.WriteLine("Ralph, Human, Hunter", "Name, Race, Classes");
Display(c1);
}
public static void Display(Character c1);
{
Console.WriteLine("Ralph, Human, Hunter", "Name, Race, Classes");
}
}
public class Character
{//start character class
//Fields
string name, race, classes;
int intellect, strength, agility, cunning, stealth;
//constructor
public Character(string x,string y,string z)
{
Name = x;
Race = y;
Classes = z;
}
public string Name
{//start name prop
get
{
return name;
}
set
{
name = value;
}
}//end name prop
public string Race
{//start race prop
get
{
return race;
}
set
{
race = value;
}
}//end name prop
public string Classes
{//start classes prop
get
{
return classes;
}
set
{
classes = value;
if (classes == "Hunter" && race == "Human")
intellect = 40;
strength = 35;
agility = 30;
cunning = 40;
stealth = 30;
if (classes == "Warrior" && race == "Human")
intellect = 40;
strength = 35;
agility = 40;
cunning = 40;
stealth = 20;
if (classes == "Cleric" && race == "Human")
intellect = 55;
strength = 30;
agility = 30;
cunning = 45;
stealth = 15;
if (classes == "Hunter" && race == "Dwarf")
intellect = 30;
strength = 70;
agility = 35;
cunning = 15;
stealth = 25;
if (classes == "Warrior" && race == "Dwarf")
intellect = 30;
strength = 60;
agility = 55;
cunning = 20;
stealth = 10;
if (classes == "Cleric" && race == "Dwarf")
intellect = 45;
strength = 70;
agility = 35;
cunning = 25;
stealth = 0;
if (classes == "Hunter" && race == "Elf")
intellect = 35;
strength = 30;
agility = 45;
cunning = 25;
stealth = 40;
if (classes == "Warrior" && race == "Elf")
intellect = 35;
strength = 20;
agility = 45;
cunning = 35;
stealth = 40;
if (classes == "Cleric" && race == "Elf")
intellect = 55;
strength = 15;
agility = 45;
cunning = 20;
stealth = 40;
}
}
public int Intellect
{//start intellect prop
get
{
return intellect;
}
}//end intellect prop
public int Strength
{//start strength prop
get
{
return strength;
}
}//end strength prop
public int Agility
{//start agility prop
get
{
return agility;
}
}//end agility prop
public int Cunning
{//start cunning prop
get
{
return cunning;
}
}//end cunning prop
public int Stealth
{//start stealth prop
get
{
return stealth;
}
}//end stealth prop
public void Output()
{
Console.WriteLine (Name);
Console.WriteLine (Race);
Console.WriteLine (Classes);
Console.WriteLine(Intellect);
Console.WriteLine (Strength);
Console.WriteLine (Agility);
Console.WriteLine (Cunning);
Console.WriteLine (Stealth);
}
}//end character
Can anyone offer assistance?