아카이브
영웅 클래스 본문
using System;
using System.Collections.Generic;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
namespace LearnDotnet
{
internal class App
{
//생성자
public App()
{
Hero heroLucio = new Hero("루시우");
Hero heroReaper = new Hero("리퍼");
Hero heroGenzi = new Hero("겐지");
Console.WriteLine(heroLucio.name);
Console.WriteLine(heroReaper.name);
Console.WriteLine(heroGenzi.name);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LearnDotnet
{
internal class Hero
{
public string name;
public Hero(string name)
{
this.name = name;
Console.WriteLine("{0} 입니다.",name);
}
}
}
방향 추가
using System;
using System.Collections.Generic;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
namespace LearnDotnet
{
internal class App
{
//생성자
public App()
{
Hero heroLucio = new Hero("루시우");
Hero heroReaper = new Hero("리퍼");
Hero heroGenzi = new Hero("겐지");
Console.WriteLine(heroLucio.name);
Console.WriteLine(heroReaper.name);
Console.WriteLine(heroGenzi.name);
heroLucio.Move("왼쪽");
heroReaper.Move("오른쪽");
heroGenzi.Move("이도저도아닌");
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace LearnDotnet
{
internal class Hero
{
public string name;
public Hero(string name)
{
this.name = name;
Console.WriteLine("{0} 입니다.",name);
}
public void Move(string direction)
{
Console.WriteLine("{0}가 {1} 방향으로 이동함", this.name, direction);
}
}
}
장비 추가
using System;
using System.Collections.Generic;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
namespace LearnDotnet
{
internal class App
{
//생성자
public App()
{
Hero heroLucio = new Hero("루시우");
Hero heroReaper = new Hero("리퍼");
Hero heroGenzi = new Hero("겐지");
Console.WriteLine(heroLucio.name);
Console.WriteLine(heroReaper.name);
Console.WriteLine(heroGenzi.name);
heroLucio.Move("왼쪽");
heroReaper.Move("오른쪽");
heroGenzi.Move("이도저도아닌");
heroLucio.Equip("음파증폭기");
heroReaper.Equip("샷건");
heroGenzi.Equip("검");
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace LearnDotnet
{
internal class Hero
{
public string name;
public Hero(string name)
{
this.name = name;
Console.WriteLine("{0} 입니다.",name);
}
public void Move(string direction)
{
Console.WriteLine("{0}가 {1} 방향으로 이동함", this.name, direction);
}
public void Equip(string weaponName)
{
Console.WriteLine("{0}가 {1}를 장착함",this.name,weaponName);
}
}
}
프로그램
using System;
namespace LearnDotnet
{
internal class Program
{
static void Main(string[] args)
{
new App();
}
}
}
다음에 할 거
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace LearnDotnet
{
internal class Hero
{
public string name;
public Hero(string name)
{
this.name = name;
Console.WriteLine("{0} 입니다.",name);
}
public void Move(string direction)
{
Console.WriteLine("{0}가 {1} 방향으로 이동함", this.name, direction);
}
public void Equip(Weapon weapon)
{
//Weopon 클래스 만들기
}
}
}