예제 #1
0
 public Instruction.Result Unpack()
 {
     // if (!Unpacker) return Instruction.Result.ERROR;
     Instruction.Result result = Instruction.Result.ERROR;
     if (container is GridContainer)
     {
         GridContainer target = null;
         GridContainer from   = (GridContainer)container;
         result = from.QueryAdjacentContainer(antOri, ref target);
         if (result == Instruction.Result.SUCCEED)
         {
             if (!target.Compatible(this))
             {
                 return(Instruction.Result.INCOMPATIBLE);
             }
             result = from.TryUnpack(this);
             if (result == Instruction.Result.SUCCEED)
             {
                 from.Release(this);
                 target.Contain(this);
                 target.HoleCheck();
                 from.TargetCheck();
             }
         }
     }
     return(result);
 }