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;
|
using RichCreator.Utility.Utilitys;
|
|
namespace RichCreator.Maps.Lindong
|
{
|
/// <summary>
|
/// 禁区类
|
/// </summary>
|
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)
|
|
};
|
}
|
/// <summary>
|
/// 五号房间的右上角区域
|
/// </summary>
|
public const Int32 AREA_5Bound = 0;
|
|
/// <summary>
|
/// 14号房间那个不动的怪
|
/// </summary>
|
public const Int32 AREA_14Bound = 1;
|
|
|
private ZTRectangle gameRect;
|
|
private DnfRole moveState;
|
|
private ZTRectangle[] bounds = null;
|
|
/// <summary>
|
/// 判断是否在禁区内
|
/// </summary>
|
/// <param name="houseIndex"></param>
|
/// <param name="rolePosition"></param>
|
/// <param name="areaID"></param>
|
/// <returns></returns>
|
public bool InOutOfBound(Int32 houseIndex, ZTPoint rolePosition,out int areaID)
|
{
|
areaID = 0;
|
switch (houseIndex)
|
{
|
case 5:
|
if (GeoHelper.IsInRect(rolePosition, bounds[AREA_5Bound]))
|
{
|
areaID = AREA_5Bound;
|
return true;
|
}
|
return false;
|
case 14:
|
areaID = AREA_14Bound;
|
break;
|
}
|
return false;
|
}
|
|
/// <summary>
|
/// 移动到正常区域
|
/// </summary>
|
/// <param name="areaID"></param>
|
/// <returns></returns>
|
public void MoveToCommonBound(Int32 areaID)
|
{
|
switch (areaID)
|
{
|
case AREA_5Bound:
|
this.moveState.SyncMove(new ZTPoint(-600, 0));
|
break;
|
}
|
}
|
|
}
|
}
|