using System;
class Program
{
static void Main(string[] args)
{
new APP();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class APP
{
//생성자
public APP()
{
//여기다가 작성..
//SCV객체 생성
SCV scv = new SCV();
scv.Move(3, 4);
scv.PrintPosition();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class SCV
{
private int x;
private int y;
public SCV()
{
Console.WriteLine("SCV생성됨 ({0},{1})", this.x, this.y);
}
//메서드 정의
//움직이다
//tx : 목표 x좌표
//ty : 목표 y좌표
public void Move(int tx, int ty) //(매개변수)
{
// x -> tx
// y -> tx
this.x = tx;
this.y = ty;
Console.WriteLine("({0},{1})로 이동완료", this.x, this.y);
}
public void PrintPosition()
{
Console.WriteLine("현재 좌표: ({0},{1})", this.x, this.y);
}
}