コード例 #1
0
        private void OnCreateMonster(object sender, RoutedEventArgs e)
        {
            var    builder         = new MonsterBuilder();
            var    directorBuilder = new MonsterDirector(builder);
            int    index           = ChangeBody.SelectedItem.ToString().LastIndexOf(':') + 2;
            string head            = ChangeHead.SelectedItem.ToString().Substring(index);
            string body            = ChangeBody.SelectedItem.ToString().Substring(index);
            string legs            = ChangeLegs.SelectedItem.ToString().Substring(index);
            string hands           = ChangeHands.SelectedItem.ToString().Substring(index);

            Monster.Text = directorBuilder.CreateMonster(head, body, hands, legs);
        }
コード例 #2
0
 public MonsterDirector(MonsterBuilder _builder)
 {
     builder = _builder;
 }