using Emgu.CV;
|
using Emgu.CV.Structure;
|
using RichCreator.Dnf;
|
using RichCreator.Utility.Captures;
|
using RichCreator.Utility.CV;
|
using RichCreator.Utility.Maps;
|
using RichCreator.Utility.Structs;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading;
|
using System.Threading.Tasks;
|
|
namespace RichCreator.Maps.Lindong
|
{
|
public class LindongMiniMap : IMiniMap
|
{
|
public LindongMiniMap(ZTRectangle gameRect):base(gameRect, new ZTPoint(721, 47))
|
{}
|
|
|
|
protected override bool GetCurrentHouse(out Int32 houseIndex, Image<Rgb, byte> image)
|
{
|
houseIndex = -1;
|
Int32 overHouseDected = -1;
|
for (int i = 0; i < 20; i++)
|
{
|
Int32 row = i / 4;
|
Int32 col = i % 4;
|
|
//目标块第一块坐标
|
Int32 x = this.MinimapOffset.X + col * 18;
|
Int32 y = this.MinimapOffset.Y + row * 18;
|
|
if (DnfCVHelper.IsCurrentHouseColor(image, x, y))
|
{
|
houseIndex = i;
|
return true;
|
}
|
|
if (i == 15)
|
{
|
//查看,14格是否青色
|
if (DnfCVHelper.IsCrossedHouseColor(image, x - 18, y))
|
{
|
//是否怪物图像
|
if ( DnfCVHelper.IsOverHouseColor(image,x,y))
|
{
|
overHouseDected = 15;
|
}
|
}
|
}
|
}
|
if (overHouseDected > -1)
|
{
|
houseIndex = overHouseDected;
|
return true;
|
}
|
return false;
|
}
|
}
|
}
|