/// <summary> /// Register a RockObject in the Dictionary. /// </summary> /// <param name="rockObject">The IRockObject</param> /// <param name="type">The RockObjectType</param> private void RegisterRockObject(IRockObject rockObject, RockObjectType type) { if (!this.objects.ContainsKey(rockObject.RockId)) { this.objects.Add(rockObject.RockId, new RockObject(rockObject, type)); } }
/// <summary> /// Is RockObject IsFriendlyCard. /// </summary> /// <param name="id">The RockId</param> /// <param name="type">The RockObjectType</param> /// <returns>True if it is a certain RockObjectType</returns> public bool IsObjectType(int id, RockObjectType type) { RockObject obj; if (this.objects.TryGetValue(id, out obj)) { if (obj.ObjectType == type) { return(true); } } return(false); }
/// <summary> /// Initializes a new instance of the <see cref="RockObject" /> class. /// </summary> /// <param name="obj">The IRockObject</param> /// <param name="type">The RockObjectType</param> public RockObject(IRockObject obj, RockObjectType type) { this.Object = obj; this.ObjectType = type; }