예제 #1
0
파일: GMareRoom.cs 프로젝트: EIREXE/shootfy
        /// <summary>
        /// Makes a shallow copy of this object.
        /// </summary>
        /// <returns>A shallow copy of this object.</returns>
        public GMareObject Clone()
        {
            // Get resource id.
            GMResource res = new GMResource();
            res.Name = (string)_resource.Name.Clone();
            res.Id = _resource.Id;
            res.LastChanged = _resource.LastChanged;

            // Get bitmap.
            Bitmap image = (Bitmap)_image.Clone();

            // Return shallow copy.
            return new GMareObject(res, image, _sprite, _depth, _originX, _originY);
        }
예제 #2
0
파일: GMareRoom.cs 프로젝트: EIREXE/shootfy
        private int _sprite = -1; // The sprite id.

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Constructs a new GMare object.
        /// </summary>
        public GMareObject(GMResource resource, Bitmap image, int sprite, int depth, int originX, int originY)
        {
            // If the image is not empty, use it.
            if (image != null)
                _image = image;

            // Set fields.
            _resource = resource;
            _sprite = sprite;
            _depth = depth;
            _originX = originX;
            _originY = originY;
        }