public override void Assemble(ModeObject modeObject) { if (this.gundam != null) { gundam.Assemble(modeObject); } }
static void Main(string[] args) { ModeObject modeObject = new ModeObject(); IMeCha myGundam = new Gundam(); Console.WriteLine("裸机:"); myGundam.Assemble(modeObject); Console.WriteLine(" 等级:" + modeObject.L); myGundam = new SSRGundam(myGundam as AdvGundam); myGundam = new TitansGundam(myGundam as AdvGundam); myGundam = new RuinGundam(myGundam as AdvGundam); myGundam = new ZeusGundam(myGundam as AdvGundam); Console.WriteLine(""); Console.WriteLine("普通组装:"); myGundam.Assemble(modeObject); Console.WriteLine(" 等级:" + modeObject.L); Console.WriteLine(""); Console.WriteLine("VIP组装:"); myGundam = new EagleGundam(myGundam as AdvGundam); myGundam.Assemble(modeObject); Console.WriteLine(" 等级:" + modeObject.L); Console.Read(); }
public override void Assemble(ModeObject modeObject) { base.Assemble(modeObject); modeObject.Refit(); Console.Write("左武器槽:摧星炮 "); }
public override void Assemble(ModeObject modeObject) { base.Assemble(modeObject); modeObject.Refit(); // 这一行代表实例化的改装,也可以是修改这个对象的东西 Console.Write("泰坦级动力引擎 "); // 代表其他的改装 }
public override void Assemble(ModeObject modeObject) { base.Assemble(modeObject); Console.Write(" "); }
public virtual void Assemble(ModeObject modeObject) { modeObject.Refit(); }