package net.sourceforge.pain.logic.fn; import net.sourceforge.pain.data.type.*; public class GetFn { public static void get(Equipped equipped, Physical target) { if (target.sameObjectAs(equipped)) { MessageOutFn.outln(equipped, "You can't do that."); return; } if (target.is(LifeForm.class)) { // maybe fight? maybe flag to fight? MessageOutFn.outln(equipped, "You can't do that."); return; } RelocateFn.relocate(target.asLocated(), equipped.getInventory()); final Interactive iTarget = target.asInteractive(); MessageOutFn.outln(equipped, "You get " + iTarget.getDesc() + "."); MessageOutFn.outSpace(equipped, "$n gets $P.", equipped, iTarget, Receptive.SEE); } }