namespace Syntax02
{
class Program
{
static void Main(string[] args)
{
new App();
}
}
}
namespace Syntax02
{
public class App
{
public App()
{
var popup1 = new UIButtonAchivement("기타 업적");
popup1.Click();
}
}
}
namespace Syntax02
{
public class UIPopupAchievement
{
//public Sprite achivImg; //팝업창트로피이미지
//public TextField achivText; //업적
//public Sprite goldImg; //골드이미지
//public TextField currentGoldText; //골드
public UIPopupAchievement()
{
//var button1 = new UIButtonAchivement("캐릭터");
//var button2 = new UIButtonAchivement("전투");
//var button3 = new UIButtonAchivement("생산");
var button4 = new UIButtonAchivement("기타");
}
}
}
using System;
namespace Syntax02
{
class UIButtonAchivement
{
public string name;
public UIButtonAchivement(string name)
{
this.name = name;
Console.WriteLine($"{name} 버튼이 생성되었습니다.");
}
public void Click()
{
UIPanelAchivement uIPanelAchivement = new UIPanelAchivement();
}
}
}
using System;
namespace Syntax02
{
public class UIPanelAchivement
{
public UIPanelAchivement()
{
Console.WriteLine("UI패널 업적이 생성되었습니다.");
var achievement1 = new Achievements("[탐험] 남부 평원", "남부 평원 지도를 모두 밝힙니다.", "완료", 100, "Gold", 1000, "trophyImg");
var achievement2 = new Achievements("[탐험] 리트바르 마굴 지하 1층", "리트바르 마굴 지하 1층 지도를 모두 밝힙니다.", "진행중", 87, "Gold", 1500, "emptyTrophyImg");
var achievement3 = new Achievements("[탐험] 황무지", "황무지 지도를 모두 밝힙니다.", "완료", 100, "Gold", 1000, "trophyImg");
var achievement4 = new Achievements("[탐험] 칭호 10개 수집", "칭호를 10회 수집합니다.", "진행중", 80, "Gold", 2000, "emptyTrophyImg");
Achievements[] arrAchivements = new Achievements[] { achievement1, achievement2, achievement3, achievement4 };
for(int i =0; i < arrAchivements.Length; i++)
{
var list = new UIListAchivement();
list.Show(arrAchivements[i]);
}
}
}
}
using System;
namespace Syntax02
{
public class UIListAchivement
{
public TextField textFieldName;
public TextField textFieldDescription;
public TextField textFieldProgress;
public TextField textFieldprogressPercentage;
public Sprite rewardImgPath;
public TextField textFieldGoldAmount;
public Sprite trophyImgPath;
public UIListAchivement()
{
Console.WriteLine($"UI리스트업적이 생성되었습니다.");
this.textFieldName = new TextField();
this.textFieldDescription = new TextField();
this.textFieldProgress = new TextField();
this.textFieldprogressPercentage = new TextField();
this.rewardImgPath = new Sprite();
this.textFieldGoldAmount = new TextField();
this.trophyImgPath = new Sprite();
}
public void Show(Achievements achievements)
{
textFieldName.Show(achievements.name);
textFieldDescription.Show(achievements.description);
textFieldProgress.Show($"업적 상태 : {achievements.progress}");
textFieldprogressPercentage.Show($"업적 진행률 : {achievements.progressPercentage} %");
rewardImgPath.Show(achievements.rewardImgPath);
textFieldGoldAmount.Show($"rewardImg의 양 : {achievements.goldAmount.ToString()}");
trophyImgPath.Show(achievements.trophyImgPath);
Console.WriteLine();
}
}
}
using System;
namespace Syntax02
{
public class TextField
{
public TextField()
{
}
public void Show(string str)
{
Console.WriteLine($"{str}");
}
}
}
using System;
namespace Syntax02
{
public class Sprite
{
public Sprite()
{
}
public void Show(string imgPath)
{
Console.WriteLine($"{imgPath}의 이미지를 불러와 보여줍니다");
}
}
}
namespace Syntax02
{
public class Achievements
{
public string name;
public string description;
public string progress;
public int progressPercentage;
public string rewardImgPath;
public int goldAmount;
public string trophyImgPath;
public Achievements(string name, string description, string progress, int progressPercentage, string rewardImgPath,int goldAmount, string trophyImgPath)
{
this.name = name;
this.description = description;
this.progress = progress;
this.progressPercentage = progressPercentage;
this.rewardImgPath = $"C/Workspace/resource/{rewardImgPath}.png";
this.goldAmount = goldAmount;
this.trophyImgPath = $"C/Workspace/resource/{trophyImgPath}.png";
}
}
}