示例#1
0
 /// <summary>
 /// Removes the given location from the room
 /// </summary>
 /// <param name="item">The room to remove</param>
 /// <returns>true if the room was in the collection, false otherwise</returns>
 private bool RemoveLocation(SpecificLocation item)
 {
     if (item == null)
     {
         return(false);
     }
     return(RemoveLocation(item.Name));
 }
示例#2
0
 /// <summary>
 /// Adds a specific location to the room
 /// </summary>
 /// <param name="item">The specific location to add to the room.</param>
 public void AddLocation(SpecificLocation item)
 {
     if (item == null)
     {
         return;
     }
     if ((item.Room != null) && (item.Room != this))
     {
         item.Room.RemoveLocation(item);
     }
     if (this.locations.ContainsKey(item.Name))
     {
         this.locations[item.Name].IsBeacon    |= item.IsBeacon;
         this.locations[item.Name].IsPlacement |= item.IsPlacement;
     }
     else
     {
         this.locations.Add(item.Name, item);
     }
     if (item.Room != this)
     {
         item.Room = this;
     }
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RoboCup.AtHome.CommandGenerator.Category"/> class.
 /// </summary>
 /// <param name="name">The name of the category.</param>
 /// <param name="defaultLocation">The default placement location for objects in the category.</param>
 public Category(string name, SpecificLocation defaultLocation)
 {
     this.Name            = name;
     this.defaultLocation = defaultLocation;
     this.objects         = new Dictionary <string, Object>();
 }
示例#4
0
        /// <summary>
        /// Adds an beacon to the room
        /// </summary>
        /// <param name="name">The name of the beacon to add.</param>
        public void AddBeacon(string name)
        {
            SpecificLocation b = new SpecificLocation(name, false, true);

            this.AddLocation(b);
        }
示例#5
0
        /// <summary>
        /// Adds an placement to the room
        /// </summary>
        /// <param name="name">The name of the placement to add.</param>
        public void AddPlacement(string name)
        {
            SpecificLocation p = new SpecificLocation(name, true, false);

            this.AddLocation(p);
        }