2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
#region ================== Copyright (c) 2007 Pascal vd Heiden
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
|
|
|
|
* This program is released under GNU General Public License
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Namespaces
|
|
|
|
|
|
|
|
using CodeImp.DoomBuilder.Geometry;
|
|
|
|
using CodeImp.DoomBuilder.Types;
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.BuilderModes
|
|
|
|
{
|
|
|
|
public struct Association
|
|
|
|
{
|
|
|
|
public int tag;
|
|
|
|
public UniversalType type;
|
2012-09-17 21:57:08 +00:00
|
|
|
public Vector2D Center { get { return center; } }
|
|
|
|
private Vector2D center;
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
// This sets up the association
|
2012-09-17 21:57:08 +00:00
|
|
|
public Association(Vector2D center, int tag, int type)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
|
|
|
this.tag = tag;
|
|
|
|
this.type = (UniversalType)type;
|
2012-09-17 21:57:08 +00:00
|
|
|
this.center = center;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This sets up the association
|
2012-09-17 21:57:08 +00:00
|
|
|
public Association(Vector2D center, int tag, UniversalType type)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
|
|
|
this.tag = tag;
|
|
|
|
this.type = type;
|
2012-09-17 21:57:08 +00:00
|
|
|
this.center = center;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This sets up the association
|
2012-09-17 21:57:08 +00:00
|
|
|
public void Set(Vector2D center, int tag, int type)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
|
|
|
this.tag = tag;
|
|
|
|
this.type = (UniversalType)type;
|
2012-09-17 21:57:08 +00:00
|
|
|
this.center = center;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This sets up the association
|
2012-09-17 21:57:08 +00:00
|
|
|
public void Set(Vector2D center, int tag, UniversalType type)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
|
|
|
this.tag = tag;
|
|
|
|
this.type = type;
|
2012-09-17 21:57:08 +00:00
|
|
|
this.center = center;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This compares an association
|
|
|
|
public static bool operator ==(Association a, Association b)
|
|
|
|
{
|
|
|
|
return (a.tag == b.tag) && (a.type == b.type);
|
|
|
|
}
|
|
|
|
|
|
|
|
// This compares an association
|
|
|
|
public static bool operator !=(Association a, Association b)
|
|
|
|
{
|
|
|
|
return (a.tag != b.tag) || (a.type != b.type);
|
|
|
|
}
|
2013-03-18 13:52:27 +00:00
|
|
|
|
|
|
|
//mxd
|
|
|
|
public override int GetHashCode()
|
|
|
|
{
|
|
|
|
return base.GetHashCode();
|
|
|
|
}
|
|
|
|
|
|
|
|
//mxd
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
{
|
|
|
|
if(!(obj is Association)) return false;
|
|
|
|
|
|
|
|
Association b = (Association)obj;
|
|
|
|
return (tag == b.tag) && (type == b.type);
|
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
}
|