Пример #1
0
        public CustomToken Copy()
        {
            Masterplan.Data.TerrainPower terrainPower;
            CustomToken customToken = new CustomToken()
            {
                ID               = this.fID,
                Type             = this.fType,
                Name             = this.fName,
                Details          = this.fDetails,
                TokenSize        = this.fTokenSize,
                OverlaySize      = this.fOverlaySize,
                OverlayStyle     = this.fOverlayStyle,
                Colour           = this.fColour,
                Image            = this.fImage,
                DifficultTerrain = this.fDifficultTerrain,
                Opaque           = this.fOpaque,
                IsTerrainLayer   = this.IsTerrainLayer,
                IsUnSelectable   = this.IsUnSelectable,
                Data             = this.fData.Copy()
            };
            CustomToken customToken1 = customToken;

            if (this.fTerrainPower != null)
            {
                terrainPower = this.fTerrainPower.Copy();
            }
            else
            {
                terrainPower = null;
            }
            customToken1.TerrainPower = terrainPower;
            customToken.CreatureID    = this.fCreatureID;
            return(customToken);
        }
Пример #2
0
        /// <summary>
        /// Creates a copy of the CustomToken.
        /// </summary>
        /// <returns>Returns the copy.</returns>
        public CustomToken Copy()
        {
            CustomToken ct = new CustomToken();

            ct.ID               = fID;
            ct.Type             = fType;
            ct.Name             = fName;
            ct.Details          = fDetails;
            ct.TokenSize        = fTokenSize;
            ct.OverlaySize      = fOverlaySize;
            ct.OverlayStyle     = fOverlayStyle;
            ct.Colour           = fColour;
            ct.Image            = fImage;
            ct.DifficultTerrain = fDifficultTerrain;
            ct.Opaque           = fOpaque;
            ct.Data             = fData.Copy();
            ct.TerrainPower     = (fTerrainPower != null) ? fTerrainPower.Copy() : null;
            ct.CreatureID       = fCreatureID;

            return(ct);
        }