Aura.Channel.World.Entities.Prop.UpdateShapes C# (CSharp) Method

UpdateShapes() public method

Updates shapes for current state from defaults db.
public UpdateShapes ( ) : void
return void
		public void UpdateShapes()
		{
			this.Shapes.Clear();

			// Get list of defaults for prop
			var defaultsList = AuraData.PropDefaultsDb.Find(this.Info.Id);
			if (defaultsList != null && defaultsList.Count != 0)
			{
				// Get first default if state is empty, or the first one that
				// matches the current state.
				var def = string.IsNullOrWhiteSpace(this.State)
					? defaultsList.First()
					: defaultsList.FirstOrDefault(a => a.State == this.State);

				if (def == null)
					Log.Warning("Prop.UpdateShapes: No defaults found for state '{0}' and prop '{1}'.", this.State, this.Info.Id);
				else
				{
					this.State = def.State;

					foreach (var shape in def.Shapes)
						this.Shapes.Add(shape.GetPoints(this.Info.Direction, (int)this.Info.X, (int)this.Info.Y));
				}
			}
		}