Esempio n. 1
0
 protected void set_last_history(MolMoveHistory history)
 {
     int count_temp = global_instance.Instance._crash_manager._History._mol_history.Count;
     if(count_temp > 0)
     {
         global_instance.Instance._crash_manager._History._mol_history.RemoveAt(count_temp - 1);
     }
     global_instance.Instance._crash_manager._History._mol_history.Add(history);
 }
Esempio n. 2
0
    public bool move_list(List<crash_mole> list, dir_move dir)
    {
        if (_need_play_animation == true)
        {
            return false;
        }
        _move_mole_list.Clear();
        List<crash_mole> enry_list = new List<crash_mole>();
        int current_count = list.Count;
        bool can_fall_temp = false;
        for (int i = 0; i < current_count; i++)
        {
            bool need_continue = false;
            int move_count = enry_list.Count;
            crash_mole cur_entry = list[i];
            if (is_in_can_not_move_list(cur_entry) == true)
            {
                continue;
            }
            for (int j = 0; j < move_count; j++)
            {
                crash_mole temp_entry = enry_list[j];
                if (temp_entry == cur_entry)
                {
                    need_continue = true;
                    break;
                }
            }
            if (need_continue == true)
            {
                continue;
            }

            _move_mole_list.Add(cur_entry);
            if (move(cur_entry, dir) == true)
            {
                move_count = _move_mole_list.Count;
                for (int j = 0; j < move_count; j++)
                {
                    enry_list.Add(_move_mole_list[j]);
                }
                update_move_list(_move_mole_list, dir);
            }
            else
            {
                _can_not_move_list.Add(cur_entry);
            }
            _move_mole_list.Clear();
        }

        _can_not_move_list.Clear();
        int cur_count = enry_list.Count;
        if (cur_count > 0)
        {
            can_fall_temp = true;
            _need_play_animation = true;
            _last_move_dir = dir;
            _move_mole_list.Clear();
            for (int i = 0; i < cur_count; i++)
            {
                _move_mole_list.Add(enry_list[i]);                
            }

			if(_record._open_record == false&& _game_state == gameState.game_playing)
            {
                MolMoveHistory history = new MolMoveHistory();
                history._dir = dir;
                foreach (crash_mole entry in _move_mole_list)
                {
                    history.move_moles.Add(entry);
                }
                _current_frame_count++;
                history._mole_move_count = _current_frame_count;
                _History._mol_history.Add(history);
            }
        }

        return can_fall_temp;
    }
Esempio n. 3
0
    protected MolMoveHistory get_last_history()
    {
        MolMoveHistory history = null;
        int count_temp = global_instance.Instance._crash_manager._History._mol_history.Count;
		if (count_temp == 0) {
			history = new MolMoveHistory ();
			global_instance.Instance._crash_manager._History._mol_history.Add (history);
		} 
		else
		{
			history = global_instance.Instance._crash_manager._History._mol_history[count_temp - 1];
			if (history.move_moles.Count != 0 && global_instance.Instance._crash_manager.need_fall_update() == false 
				&& global_instance.Instance._crash_manager._need_play_animation == false) 
			{
				history = new MolMoveHistory ();
				global_instance.Instance._crash_manager._History._mol_history.Add (history);
			}
		}
        return history;        
    }