コード例 #1
0
ファイル: Piano.cs プロジェクト: Mary62442/CsharpPlayground
        public int CompareTo(IInstrument other)
        {
            if (other == null)
            {
                return(1);
            }
            Piano otherFlute = (Piano)other;

            return(InstrumentName.CompareTo(otherFlute.InstrumentName) +
                   InstrumentGroup.CompareTo(otherFlute.InstrumentGroup) +
                   InstrumentValue.CompareTo(otherFlute.InstrumentValue) +
                   IsAntiquity.CompareTo(otherFlute.IsAntiquity) +
                   PianoBrand.CompareTo(otherFlute.PianoBrand) +
                   PianoType.CompareTo(otherFlute.PianoType));
        }
コード例 #2
0
ファイル: Guitar.cs プロジェクト: Mary62442/CsharpPlayground
        public int CompareTo(IInstrument other)
        {
            if (other == null)
            {
                return(1);
            }
            Guitar otherFlute = (Guitar)other;

            return(InstrumentName.CompareTo(otherFlute.InstrumentName) +
                   InstrumentGroup.CompareTo(otherFlute.InstrumentGroup) +
                   InstrumentValue.CompareTo(otherFlute.InstrumentValue) +
                   IsAntiquity.CompareTo(otherFlute.IsAntiquity) +
                   GuitarBrand.CompareTo(otherFlute.GuitarBrand) +
                   GuitarType.CompareTo(otherFlute.GuitarType));
        }
コード例 #3
0
        public int CompareTo(IInstrument other)
        {
            if (other == null)
            {
                return(1);
            }
            Flute otherFlute = (Flute)other;

            return(InstrumentName.CompareTo(otherFlute.InstrumentName) +
                   InstrumentGroup.CompareTo(otherFlute.InstrumentGroup) +
                   InstrumentValue.CompareTo(otherFlute.InstrumentValue) +
                   IsAntiquity.CompareTo(otherFlute.IsAntiquity) +
                   FluteBrand.CompareTo(otherFlute.FluteBrand) +
                   Material.CompareTo(otherFlute.Material) +
                   FluteType.CompareTo(otherFlute.FluteType));
        }