using RichCreator.Utility;
using RichCreator.Utility.Structs;
using RichCreator.StateMachines;
using RichCreator.Utilitys;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RichCreator.Dnf;
namespace RichCreator.Maps.Lindong
{
///
/// 禁区类
///
public class OutOfBounds
{
public OutOfBounds(ZTRectangle gameRect,DnfRole moveState)
{
this.moveState = moveState;
this.gameRect = gameRect;
bounds = new ZTRectangle[] {
new ZTRectangle (1089+gameRect.Start.X,0+gameRect.Start.Y,1280+gameRect.End.X,394+gameRect.End.Y)
};
}
///
/// 五号房间的右上角区域
///
public const Int32 AREA_5Bound = 0;
///
/// 14号房间那个不动的怪
///
public const Int32 AREA_14Bound = 1;
private ZTRectangle gameRect;
private DnfRole moveState;
private ZTRectangle[] bounds = null;
///
/// 判断是否在禁区内
///
///
///
///
///
public bool InOutOfBound(Int32 houseIndex, ZTPoint rolePosition,out int areaID)
{
areaID = 0;
switch (houseIndex)
{
case 5:
if (Utilitys.Utils.IsInRect(rolePosition, bounds[AREA_5Bound]))
{
areaID = AREA_5Bound;
return true;
}
return false;
case 14:
areaID = AREA_14Bound;
break;
}
return false;
}
///
/// 移动到正常区域
///
///
///
public void MoveToCommonBound(Int32 areaID)
{
switch (areaID)
{
case AREA_5Bound:
this.moveState.SyncMove(new ZTPoint(-600, 0));
break;
}
}
}
}