コード例 #1
0
ファイル: MonsterManager.xaml.cs プロジェクト: nahumcn/RooSim
        private void DB_ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            MonsterDB_Binding temp = (MonsterDB_Binding)DB_ListBox.SelectedItem;

            if (temp != null)
            {
                now_mob.ChangeValue(temp);
            }

            MobName.Focus();
        }
コード例 #2
0
        private void Add_DB_Click(object sender, RoutedEventArgs e)
        {
            if (string.Compare(MobName.Text, "") == 0)
            {
                return;
            }

            _DB.AddMonsterDB(new MonsterDB(now_mob));
            BindingMobList.AddList(new MonsterDB(now_mob));

            InitializeContents();
            MobName.Focus();
            _isNew = true;
        }
コード例 #3
0
    public static Mob getMob(MobName name)
    {
        Mob tempMob;

        switch (name)
        {
        case MobName.Wolf:
            tempMob               = new Mob("Wolf", 65, 65, true, true, 2, 5, 10);
            tempMob.Id            = (int)MobName.Wolf;
            tempMob.GetGameObject = Resources.Load("Mobs/Wolf") as GameObject;
            break;

        case MobName.Bear:
            tempMob    = new Mob("Bear", 300, 300, true, true, 19, 13, 7);
            tempMob.Id = (int)MobName.Bear;
            break;

        case MobName.Fox:
            tempMob    = new Mob("Fox", 30, 30, false, true, 3, 3, 9);
            tempMob.Id = (int)MobName.Fox;
            break;

        case MobName.Deer:
            tempMob    = new Mob("Deer", 45, 45, false, true, 2, 2, 7);
            tempMob.Id = (int)MobName.Deer;
            break;

        case MobName.Rabbit:
            tempMob    = new Mob("Rabbit", 45, 45, false, true, 2, 2, 4);
            tempMob.Id = (int)MobName.Rabbit;
            break;

        case MobName.Cougar:
            tempMob    = new Mob("Cougar", 45, 45, true, true, 2, 2, 15);
            tempMob.Id = (int)MobName.Cougar;
            break;

        default:
            tempMob = new Mob();
            break;
        }

        return(tempMob);
    }
コード例 #4
0
        public MonsterManager(ref DBlist DB)
        {
            _DB = DB;
            InitializeComponent();

            if (_DB._mob_db == null)
            {
                now_mob.MobId = 0;
            }
            else
            {
                now_mob.MobId = _DB._mob_db.Count();
            }

            DataContext = now_mob;
            InitializeContents();

            BindingMobList         = new MonsterListBox(ref _DB);
            DB_ListBox.ItemsSource = BindingMobList;

            MobName.Focus();
        }
コード例 #5
0
 private void New_DB_Click(object sender, RoutedEventArgs e)
 {
     InitializeContents();
     MobName.Focus();
 }
コード例 #6
0
ファイル: Mob.cs プロジェクト: Bcantz27/WildernessSurvival
    public static Mob getMob(MobName name)
    {
        Mob tempMob;
        switch (name)
        {
            case MobName.Wolf:
                tempMob = new Mob("Wolf", 65, 65, true, true,2,5,10);
                tempMob.Id = (int)MobName.Wolf;
                tempMob.GetGameObject = Resources.Load("Mobs/Wolf") as GameObject;
                break;
            case MobName.Bear:
                tempMob = new Mob("Bear", 300, 300, true, true, 19,13,7);
                tempMob.Id = (int)MobName.Bear;
                break;
            case MobName.Fox:
                tempMob = new Mob("Fox", 30, 30, false, true, 3, 3,9);
                tempMob.Id = (int)MobName.Fox;
                break;
            case MobName.Deer:
                tempMob = new Mob("Deer", 45, 45, false, true, 2, 2,7);
                tempMob.Id = (int)MobName.Deer;
                break;
            case MobName.Rabbit:
                tempMob = new Mob("Rabbit", 45, 45, false, true, 2, 2,4);
                tempMob.Id = (int)MobName.Rabbit;
                break;
            case MobName.Cougar:
                tempMob = new Mob("Cougar", 45, 45, true, true, 2, 2,15);
                tempMob.Id = (int)MobName.Cougar;
                break;

            default:
                tempMob = new Mob();
                break;
        }

        return tempMob;
    }