Exemple #1
0
        /// <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);
        }
Exemple #2
0
        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;
        }