ふらっとC#,C♯,C#(初心者用) Part31
at TECH
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