Beispiel #1
0
    public List <MapObject> GetCollisionList(int tileX, int tileY)
    {
        if (tileX < 0 || _width <= tileX)
        {
            return(null);
        }
        if (tileY < 0 || _height <= tileY)
        {
            return(null);
        }

        TileCell tileCell = GetTileCell(tileX, tileY);

        return(tileCell.GetCollsionList());
    }
    void AttackAction()
    {
        TileCell targetCell = _character.GetTargetTileCell();

        if (null == targetCell)
        {
            return;
        }

        if (_rangeViewer.CheckRange(targetCell))
        {
            List <MapObject> collisonList = targetCell.GetCollsionList();
            for (int i = 0; i < collisonList.Count; i++)
            {
                MapObject mapObject = collisonList[i];
                if (eMapObjectType.MONSTER == mapObject.GetObjectType())
                {
                    _character.SetTarget(mapObject);
                    _nextState = eStateType.ATTACK;
                    return;
                }
            }
        }
    }