- 275 名前:デフォルトの名無しさん mailto:sage [2009/09/03(木) 12:06:16 ]
- ジュネリックコレクション型のcontainがうまくいかなくて困っています
配列へコピーしてもダメで困っているのですがどうしたらいいのでしょうか? public class Location{ public int x, y, z; public void data(Location position){ this.x = position.x; this.y = position.y; this.z = position.z; } public void data(int x, int y, int z){ this.x = x; this.y = y; this.z = z; } } static void Main(string[] args){ Location pos1 = new Location(); Location pos2 = new Location(); List<Location> FilePosList = new List<Location>(); pos1.x = 5; pos1.y = 10; pos1.z = 20; pos2.x = 5; pos2.y = 10; pos2.z = 20; FilePosList.Add(pos2); if (FilePosList.Contains(pos1)) { Console.WriteLine("値が一致しました"); } }
|

|