本文整理汇总了Golang中pulogic.ICreature.GetMovement方法的典型用法代码示例。如果您正苦于以下问题:Golang ICreature.GetMovement方法的具体用法?Golang ICreature.GetMovement怎么用?Golang ICreature.GetMovement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulogic.ICreature
的用法示例。
在下文中一共展示了ICreature.GetMovement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: CheckMovement
// CheckMovement checks if a creature can move to this tile
func (t *Tile) CheckMovement(_creature pul.ICreature, _dir int) int {
movement := _creature.GetMovement()
blocking := t.Blocking
if blocking != TILEBLOCK_WALK {
if blocking == TILEBLOCK_BLOCK ||
(blocking == TILEBLOCK_SURF && movement != MOVEMENT_SURF) ||
(blocking == TILEBLOCK_TOP && _dir == DIR_SOUTH) ||
(blocking == TILEBLOCK_BOTTOM && _dir == DIR_NORTH) ||
(blocking == TILEBLOCK_LEFT && _dir == DIR_EAST) ||
(blocking == TILEBLOCK_RIGHT && _dir == DIR_WEST) ||
(blocking == TILEBLOCK_TOPLEFT && (_dir == DIR_EAST || _dir == DIR_SOUTH)) ||
(blocking == TILEBLOCK_TOPRIGHT && (_dir == DIR_WEST || _dir == DIR_SOUTH)) ||
(blocking == TILEBLOCK_BOTTOMLEFT && (_dir == DIR_EAST || _dir == DIR_NORTH)) ||
(blocking == TILEBLOCK_BOTTOMRIGHT && (_dir == DIR_WEST || _dir == DIR_NORTH)) {
return RET_NOTPOSSIBLE
}
}
return RET_NOERROR
}