ふらっとC#,C♯,C#(初心者用) Part31at TECH
ふらっとC#,C♯,C#(初心者用) Part31 - 暇つぶし2ch300:デフォルトの名無しさん
08/10/02 15:35:35
>>293
どうしても配列でやりたいみたいだから書いてみた。

void ShoriMain(){
int now_enemyCount = enemy.pArr.Length;
Point[] tmpArr = ZahyouKeisan.GetZahyou();
int add_enemyCount = tmpArr.Length;
int new_enemyCount = now_enemyCount + add_enemyCount;
//配列の長さを変更
Array.Resize(ref enemy.pArr, new_enemyCount);

//新しい配列を末尾に追加
int count = now_enemyCount;
for (int i = 0; i < tmpArr.Length; i++)
{
count += i;
enemy.pArr[count] = tmpArr[i];
}
}

struct Tekiki{
 public string Name;
 public Point[] pArr;
}
static class ZahyouKeisan{
 public static Point[] GetZahyou(){
   List<Point> pList=new List<Point>();
  //いろいろ計算
  return pList.ToArray();
 }
}


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch