public GridData(int index, GRID_TYPE type, Neighbor[] neighbors) { Index = index; GridType = type; Neighbors = neighbors; }
Value<bool> IPlayer.Move(Neighbor.DIRECTION dir) { var returnValue = new Value<bool>(); var result = CheckMove(dir); returnValue.SetValue(result); return result; }
public bool CheckMove(Neighbor.DIRECTION move_direction) { var user = _Users[_Currect]; var neighbors = Singleton<Resource>.Instance.FindGridData(user.Position.GridIndex) .Neighbors; var result = neighbors.Where(neighbor => neighbor.Dir == move_direction) .Any(neighbor => neighbor.Index != 0); if(result) { StepCal.Move(); } return result; }