private static void MakeChampionsColorData() { var championList = ChampionManager.CreateChampionList(); ChampionColorDatas = new float[championList.Count, time, rang *rang, 4]; foreach (Champion champion in championList) { Bitmap championBitmap = new Bitmap(@"LOLChampions\" + champion.nameEn + ".png"); for (int way = 0; way < time; way++) { var resultPosion = GetDotPosition(way, true); int startX = resultPosion[0]; int startY = resultPosion[1]; startX -= rang / 2; startY -= rang / 2; int endX = startX + rang, endY = startY + rang; int rangIndex = 0; for (int x = startX; x < endX; x++) { for (int y = startY; y < endY; y++) { Color championColor = championBitmap.GetPixel(x, y); ChampionColorDatas[champion.index, way, rangIndex, 0] = championColor.GetHue(); ChampionColorDatas[champion.index, way, rangIndex, 1] = championColor.R; ChampionColorDatas[champion.index, way, rangIndex, 2] = championColor.G; ChampionColorDatas[champion.index, way, rangIndex, 3] = championColor.B; rangIndex++; } } } } }
public MainWindow() { InitializeComponent(); this.DataContext = this; Logging.LogManager.AddLogProcessor(this); string applicationPath = Directory.GetCurrentDirectory(); string[] pathsToSeedData = new string[] { applicationPath, "..", "..", "..", "AP_ITEM_DATASET" }; _RootSeedDataFileDir_ = System.IO.Path.Combine(pathsToSeedData); string[] pathsToCacheData = new string[] { applicationPath, "..", "..", "..", "CachedData" }; _RootDataCacheFileDir_ = System.IO.Path.Combine(pathsToCacheData); _cacheDirectoryManager = new CacheDirectoryManager(_RootDataCacheFileDir_); LogManager.LogMessage("Verifying cache folder structure..."); _cacheDirectoryManager.VerifyFolderStructure(); LogManager.LogMessage("Cache folder structure setup."); LoadAPIConfig(_cacheDirectoryManager.APIConfigFilePath); _apiConnection = new RiotRestAPI.APIConnection(_apiConfig); _versionManager = new VersionManager(_apiConnection); _matchManager = new MatchManager(_apiConnection, _cacheDirectoryManager.MatchDataFolderPath); _itemManager = new ItemManager(_apiConnection, _cacheDirectoryManager.ItemDataFolderPath); _championManager = new ChampionManager(_apiConnection, _cacheDirectoryManager.ChampionDataFolderPath); }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } DontDestroyOnLoad(this.gameObject); }
public static Champion GetChapion(BitmapSource bitmapSource) { if (ChampionColorDatas == null) { MakeChampionsColorData(); } Bitmap bitmap = GetBitmapFromBitmapSource(bitmapSource); List <Champion> champions = ChampionManager.CreateChampionList(); for (int way = 0; way < time; way++) { foreach (Champion champion in champions) { if (CheckChampionImage(champion, way, bitmap)) { champion.point++; } } if (way == time - 1) { for (int point = time; 0 < point; point--) { foreach (Champion champion in champions) { if (champion.point == point) { //champion.nameKr += champion.point; return(champion); } } } } } return(null); }