GameGraphics.GraphicsObject.GetID C# (CSharp) Method

GetID() public method

Returns the objects unique ID.
public GetID ( ) : int
return int
        public int GetID()
        {
            return this.id;
        }

Usage Example

 /**
  * Update takes a GraphicsObject as a parameter. If there is an object with the
  * same ID we will update the existing object with the new info otherwise we add
  * the object to our dictionary of object
  *
  * @param obj The object that needs to be updated
  */
 public void Update(GraphicsObject obj)
 {
     GraphicsObject value;
     if (this.dictionary.TryGetValue(obj.GetID(), out value))
     {
         // we have it so we just need to update it
         value.SetX(obj.GetX());
         value.SetY(obj.GetY());
         value.SetAngle(obj.GetAngle());
     }
     else
     {
         // we dont have it so we need to add it
         this.dictionary.Add(obj.GetID(), obj);
     }
 }