Ejemplo n.º 1
0
 /// <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));
     }
 }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
 /// <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;
 }