ふらっとC#,C♯,C#(初心者用) Part31 at TECH
[2ch|▼Menu]
300:デフォルトの名無しさん
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

5377日前に更新/215 KB
担当:undef