public diskInfo getDisk(int le, bool ifPhysicManager) { diskInfo Cu_disk = null; //当前飞碟链表信息 if (free.Count > 0) { Cu_disk = free [0]; Cu_disk.reset(le); pastdisk.Add(free [0]); free.Remove(free [0]); } else { DNum++; Cu_disk = new diskInfo(DNum, le, ifPhysicManager); pastdisk.Add(Cu_disk); } return(Cu_disk); }
public diskInfo getDisk(int lever, bool ifPhysicManager) { diskInfo nowDisk = null; if (free.Count > 0) { nowDisk = free [0]; nowDisk.reset(lever); used.Add(free [0]); free.Remove(free [0]); } else { allDiskNum++; nowDisk = new diskInfo(allDiskNum, lever, ifPhysicManager); used.Add(nowDisk); } return(nowDisk); }