static void Main( string[] args ) { Messenger.Input = Console.ReadLine; Messenger.Message.Subscribe( MessageWriter ); var hero = new HeroBattler( Messenger, "勇者", 20, 20 ); var witch = new HeroBattler( Messenger, "魔女", 18, 18 ); var enemy = new Battler( Messenger, "スキュラ", 20, 20 ); var enemy2 = new Battler( Messenger, "モノアイ", 16, 16 ); var atackSkill = new Skill( "攻撃", 1, 1, Atack ); var pluralAtackSkill = new Skill( "連続攻撃", 1, 1, PluralAtack ); var starSkill = new Skill( "星を落とす魔法", 1, 3, StarMagic ); var fireSkill = new Skill( "炎の剣", 2, 1, FireSlash ); hero.AddSkill( atackSkill ); hero.AddSkill( pluralAtackSkill ); hero.AddSkill( fireSkill ); witch.AddSkill( atackSkill ); witch.AddSkill( starSkill ); enemy.AddSkill( atackSkill ); enemy.AddSkill( pluralAtackSkill ); enemy2.AddSkill( atackSkill ); var battle = new Battle( Messenger, new[] { hero, witch }, new[] { enemy, enemy2 } ); var sub = battle.Run().ToMicrothread(); while( sub.Current == BattleState.Fighting ) { sub.Yield(); } Console.WriteLine( "End" ); Console.ReadLine(); }
public Tactics( Skill skill, IEnumerable<Battler> doers, IEnumerable<Battler> targets ) { this.Skill = skill; this.Doers = doers; this.Targets = targets; }
public virtual void AddSkill( Skill skill ) { Score.Skills.Add( skill ); }