コード例 #1
0
        /// <summary>
        /// Returns a collection of behaviors containing the identifier and tag data.
        /// </summary>
        public TileBehaviorCollection GetBehaviors(string identifier, object value)
        {
            TileBehaviorCollection c = new TileBehaviorCollection();

            c.AddRange(this.Where(t => t.Datas.Any(tuple => tuple.Item1 == identifier && tuple.Item2 == value)));
            return(c);
        }
コード例 #2
0
        public static TileBehaviorCollection FromList(List <TileBehavior> l)
        {
            TileBehaviorCollection c = new TileBehaviorCollection();

            c.AddRange(l);
            return(c);
        }
コード例 #3
0
 /// <summary>
 /// Returns a collection of behaviors container the tag.
 /// </summary>
 public TileBehaviorCollection GetBehaviors(string tag)
 {
     return(TileBehaviorCollection.FromList(this.Where(u => u.Tags.Contains(tag)).ToList()));
 }