public MusicianPostController(IArtist artist, IArtistMusician artistMusician, IMusician musician, IImage image)
 {
     _artist         = artist;
     _artistMusician = artistMusician;
     _musician       = musician;
     _image          = image;
 }
Esempio n. 2
0
 public Earthling(IPhysicsBehavior physicsBehavior,
                  IProgrammerBehavior programmerBehavior,
                  IMusician musician)
 {
     this.PhysicsBehavior    = physicsBehavior;
     this.ProgrammerBehavior = programmerBehavior;
     this.Musician           = musician;
 }
 public SearchRestController(IArtist artist, IGenre genre, IAlbum album, IMusician musician, IArtistGenre artistGenre)
 {
     _artist      = artist;
     _genre       = genre;
     _album       = album;
     _musician    = musician;
     _artistGenre = artistGenre;
 }
Esempio n. 4
0
    static void Main()
    {
        TalentedPerson dude     = new TalentedPerson();
        IMusician      musician = dude;

        musician.PlayMusic();
        dude.PlayMusic();
        dude.DoALittleDance();
    }
 public MusicianModController(IArtist artist, IArtistMusician artistMusician, IMusician musician,
                              IImage image, IInstrument instrument, IMusicianInstrument musicianInstrument)
 {
     _artist             = artist;
     _artistMusician     = artistMusician;
     _musician           = musician;
     _image              = image;
     _instrument         = instrument;
     _musicianInstrument = musicianInstrument;
 }
Esempio n. 6
0
 public ArtistPostController(IGenre genre, IArtist artist, IArtistGenre artistGenre, IImage image,
                             IArtistMusician artistMusician, IMusician musician, IAlbum album, ISong song)
 {
     _genre          = genre;
     _artist         = artist;
     _artistGenre    = artistGenre;
     _image          = image;
     _artistMusician = artistMusician;
     _album          = album;
     _musician       = musician;
     _song           = song;
 }
        static void Main(string[] args)
        {
            // Console.WriteLine("Hello World!");
            //   Tim tim = new Tim(20, 900, "Timbo");
            Tim tim = new Tim("Tim", 24, 20, 900);

            System.Console.WriteLine(tim.Name);
            System.Console.WriteLine(tim.Orders);
            System.Console.WriteLine(tim.CalculateTime());

            Chris chris = new Chris(400, "Chris", 30);

            System.Console.WriteLine(chris.CalculateTime());
            System.Console.WriteLine(chris.EatDoritos());
            System.Console.WriteLine(tim.EatDoritos());

            System.Console.WriteLine((tim as IOrderWriter).Orders);

            List <IDeveloper> developers  = new List <IDeveloper>();
            Kaleb             kaleb       = new Kaleb("Kaleb", 29);
            Music             kalebsMusic = (kaleb as IMusician).PlayMusic();

            // kaleb.
            developers.Add(tim);
            developers.Add(chris);
            developers.Add(kaleb);
            developers.ForEach(developer =>
            {
                if (developer is Person)
                {
                    // NOTE Two different ways of casting to a type
                    Person p      = developer as Person;
                    Person person = (Person)developer;
                    System.Console.WriteLine($"Hi my name is {p.Name}");
                }
                if (developer is IMusician)
                {
                    IMusician ownMusicMaker = (IMusician)developer;
                    Music selfMadeMusic     = ownMusicMaker.PlayMusic();
                    developer.WriteCode(selfMadeMusic);
                }
                developer.WriteCode(kalebsMusic);
            });
        }