AS3 では、さまざまな形状を空間内の点に関連付ける [点] ---> [形状] 型の連想配列が必要です。私はこの振る舞いをしたいと思います:
var dict : Dictionary = new Dictionary();
var pos : Point = new Point(10, 10);
dict[pos] = new Shape();
var equalPos : Point = new Point (pos.X, pos.Y);
dict[equalPos] // <-- returns undefined and not the shape i created before because equalPos reference is different from pos.
ポイントは参照が異なりますが、座標として等しい(クラスメンバーと等しい)ため、dict[equalPos]
同じものを返す必要があります。dict[pos]
これを達成する方法はありますか?