转移

归属对象可以由所有者转移到另一个地址。

sui::transfer::transfer(obj, recipient);

我们可以提供一个转移入口函数,供玩家将城堡转移给其他人。

castle.move 中创建一个 transfer_castle 入口函数:

#[allow(lint(custom_state_change))]
/// 转移城堡
entry fun transfer_castle(castle: Castle, to: address) {
    transfer::transfer(castle, to);
}