/// <summary> /// /// </summary> /// <param name="idx"></param> /// <param name="wait"></param> public void CreateInsertNew(int idx, int wait) { SquareTilesTransposeFrame tmp = new SquareTilesTransposeFrame(tileNumX, tileNumY); tmp.wait = (short)wait; this.Insert(idx, tmp); }
/// <summary> /// 新しく追加 /// </summary> public void NewAdd() { SquareTilesTransposeFrame tmp = new SquareTilesTransposeFrame(tileNumX, tileNumY); tmp.wait = 1; aTCF.Add(tmp); frameNum = (short)aTCF.Count; this.TimeReset(); }
/// <summary> /// /// </summary> /// <param name="aaMapChip"></param> public void CopyAdd(D2ArrayObject <FSquareTileInfoMap> aaMapChip) { SquareTilesTransposeFrame tmp = new SquareTilesTransposeFrame(tileNumX, tileNumY, aaMapChip, tilePosX, tilePosY); tmp.wait = 1; aTCF.Add(tmp); frameNum = (short)aTCF.Count; this.TimeReset(); }
/// <summary> /// 置き換えデータの読み込み /// </summary> /// <param name="rTC"></param> /// <param name="lChank"></param> /// <returns></returns> private bool FF_LoadStageFileTC(ref SquareTilesTranspose rTC, LoadChank lChank) { LoadChank lChank02; LoadData lData; Chunk chank = new Chunk(); int nCnt; if (lChank != null) { lChank.GetBlockChank(chank); // チャンクブロックチェックしない // IDから処理選択 while ((lData = lChank.FindChank(chank)) != null) { if (chank.id == FSquareTilesTransposeFrame.ID) { SquareTilesTransposeFrame stTCF = new SquareTilesTransposeFrame(); // チェック if (chank.num == 0) { throw new IOException("FSquareTilesTransposeHeader チャンク数が異常です。"); } nCnt = 0; while ((lChank02 = lData.FindData(stTCF)) != null || !lData.GetFindEnd()) { rTC.Add(stTCF); if (lChank02 != null) { if (!this.FF_LoadStageFileTCF(ref rTC, ref stTCF, lChank02)) { return(false); } } lChank02 = null; ++nCnt; stTCF = new SquareTilesTransposeFrame(); } break; } else { // FFID_MAPCHIP_INFO以外のIDが今現在存在しないで // 怪しい値を見つけたらエラーをはき出すようにする throw new IOException("未対応のIDが呼ばれた。"); } } } return(true); }
/// <summary> /// 置き換えタイル群の1フレーム読み込み /// </summary> /// <param name="rTC"></param> /// <param name="rTCF"></param> /// <param name="lChank"></param> /// <returns></returns> private bool FF_LoadStageFileTCF(ref SquareTilesTranspose rTC, ref SquareTilesTransposeFrame rTCF, LoadChank lChank) { FSquareTileInfoMap ffMIM; LoadChank lChank02; LoadData lData; Chunk chank = new Chunk(); int cnt; int i, j; if (lChank != null) { lChank.GetBlockChank(chank); // チャンクブロックチェックしない // IDから処理選択 while ((lData = lChank.FindChank(chank)) != null) { if (chank.id == FSquareTileInfoMap.ID) { ffMIM = new FSquareTileInfoMap(); // チェック if (chank.num == 0) { throw new IOException("FSquareTilesTransposeHeader チャンク数が異常です。"); } rTCF.aaMapChip = new D2ArrayObject <FSquareTileInfoMap>(rTC.tileNumX, rTC.tileNumY); cnt = 0; i = j = 0; while ((lChank02 = lData.FindData(rTCF.aaMapChip[i, j])) != null || !lData.GetFindEnd()) { if (++cnt >= chank.num) { break; } i = cnt / rTC.tileNumX; j = cnt % rTC.tileNumX; } break; } else { // 上記以外のIDが今現在存在しないで // 怪しい値を見つけたらエラーをはき出すようにする throw new IOException("未対応のIDが呼ばれた。"); } } } return(true); }
/// <summary> /// 指定位置に挿入 /// </summary> /// <param name="index"></param> /// <param name="r"></param> public void Insert(int index, SquareTilesTransposeFrame r) { aTCF.Insert(index, r); frameNum = (short)aTCF.Count; this.TimeReset(); }
/// <summary> /// 追加 /// </summary> /// <param name="r">追加対象</param> public void Add(SquareTilesTransposeFrame r) { aTCF.Add(r); frameNum = (short)aTCF.Count; this.TimeReset(); }