예제 #1
0
파일: Space.cs 프로젝트: Aaverett/sixstar
        /// <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;
        }
예제 #2
0
        /// <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;
        }
예제 #3
0
파일: Space.cs 프로젝트: Aaverett/sixstar
 /// <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);
예제 #4
0
        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;
        }