using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    internal class TerranSCV
    {
        int hp;
        int maxHp = 60;
        int damage = 6;
        int armor = 0;

        public TerranSCV()
        {
            hp = maxHp;
            Console.WriteLine("SCV가 생성되었습니다. ({0}/{1})",hp,maxHp);
            Console.WriteLine("공격력: {0}", damage);
            Console.WriteLine("방어력 {0}", armor);
        }
        public void move()
        {
            Console.WriteLine("SCV가 이동합니다.");
        }
        
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            TerranSCV terranSCV = new TerranSCV();

            terranSCV.move();
        }
    }
}

반응형

'KDT > C# 프로그래밍' 카테고리의 다른 글

DropShip 구현 예제  (0) 2023.07.21
플레이어, 몬스터, 무기  (0) 2023.07.21
도전문제 4번  (0) 2023.07.20
인벤토리  (0) 2023.07.20
도전 문제 3번  (0) 2023.07.20

+ Recent posts