public MusicMajor() { health = 16; maxHP = 16; strength = 3; power = 0; charge = 0; defense = 0; guard = 0; baseAccuracy = 14; accuracy = 14; dexterity = 4; evasion = 0; type = "Music Major"; passive = new Performance(this); quirk = Quirk.GetQuirk(this); special = new Trumpet(); special2 = new Warsong(); player = false; champion = false; recruitable = true; CreateDrops(); attackEffect = "enemy loses 1 charge"; }
public static Instrument GetInstrument(string instrument) { Instrument inst; switch (instrument.ToLower()) { case "guittar": inst = new Guittar(); break; case "bax": inst = new Bax(); break; case "drums": inst = new Drums(); break; case "piano": inst = new Piano(); break; case "trumpet": inst = new Trumpet(); break; default: throw new ArgumentException("No existe un instrumento de tipo " + instrument); } return(inst); }
public IInstrument GetInstrument(InstrumentType type) { IInstrument instrument = null; bool found = instruments.TryGetValue(type, out instrument); if (!found) { if (type == InstrumentType.Violin) { instrument = new Violin(); instruments.Add(type, instrument); } else if (type == InstrumentType.Trumpet) { instrument = new Trumpet(); instruments.Add(type, instrument); } else { instrument = new Drum(); instruments.Add(type, instrument); } } return(instrument); }
static void ClientSender() { while (true) { Thread.Sleep(1000); Trumpet.Blow("kittens", "meow"); Trumpet.Blow("puppies", "woof"); Trumpet.Blow("puppies", "another woof"); } }
static void ClientListener() { Trumpet.Blowed += delegate(string song, string notes) { Console.WriteLine("Trumpet blowed! ({0}, {1})", song, notes); }; Trumpet.Listen("kittens"); Trumpet.Listen("puppies"); while (true) { Thread.Sleep(1000); } }
public void Executive(ConsoleKeyInfo key) { if (key.Key == ConsoleKey.Enter) { bool @is = false; foreach (Trumpet pipe in pipes) { if (cursor.Y == pipe.Height && pipe.Width == cursor.X) { @is = true; break; } } if (!@is) { for (int i = 0; i < sources.Count; i++) { if (sources[i] != null) { if (cursor.Y == sources[i].Height && sources[i].Width == cursor.X) { sources.RemoveAt(i); break; } } } Trumpet trumpet = new Trumpet(cursor.X, cursor.Y); pipes.Add(trumpet); } else { for (int i = 0; i < pipes.Count - 1; i++) { if (cursor.Y == pipes[i].Height && pipes[i].Width == cursor.X) { Trumpet trumpet = new Trumpet(cursor.X, cursor.Y); pipes.RemoveAt(i); pipes.Add(trumpet); break; } } } } }
public IInstrument GetInstrument(InstrumentType type) { IInstrument instrument = null; bool found = instruments.TryGetValue(type, out instrument); if (!found) { if (type == InstrumentType.Violin) { instrument = new Violin(); instruments.Add(type, instrument); } else if(type == InstrumentType.Trumpet) { instrument = new Trumpet(); instruments.Add(type, instrument); } else { instrument = new Drum(); instruments.Add(type, instrument); } } return instrument; }
public override void TestConstructor() { Trumpet t = new Trumpet(); Assert.AreEqual("Toot", t.Sound); }