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();
}
}