/// <summary> /// Creates a new space-paint association object adds it to the collection of space paint items /// </summary> /// <param name="surface">The surface type in question</param> /// <returns>new space paint item</returns> public SpacePaint CreateSpacePaintItemForSurfaceType(SpacePaintSurface surface) { SpacePaint sp = new SpacePaint(); sp.Space = this; sp.Surface = surface; SpacePaintItems.Add(sp); return sp; }
/// <summary> /// Returns the area of the given type within this space /// </summary> /// <param name="surface">The type of area to be painted</param> /// <returns>area to be painted</returns> public override double AreaForSurfaceType(SpacePaintSurface surface) { double ret = 0; if(surface == SpacePaintSurface.Walls) { ret = WallArea; } else if (surface == SpacePaintSurface.Ceiling) { ret = CeilingArea; } else if(surface == SpacePaintSurface.Floor) { ret = FloorArea; } return ret; }
/// <summary> /// Returns the area of the given type within this space /// </summary> /// <param name="surface">The type of area to be painted</param> /// <returns>area to be painted</returns> public abstract double AreaForSurfaceType(SpacePaintSurface surface);
protected override SpacePaintSurface[] GetSurfaceTypes() { SpacePaintSurface[] surfaceTypes = new SpacePaintSurface[4]; surfaceTypes[0] = SpacePaintSurface.Walls; surfaceTypes[1] = SpacePaintSurface.Ceiling; surfaceTypes[2] = SpacePaintSurface.Floor; surfaceTypes[3] = SpacePaintSurface.Item; return surfaceTypes; }