<commit_before>package com.example.predator.map;

//import android.R;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.View;

import com.example.predator.R;
import com.example.predator.GameState;
import com.example.predator.StateManager;

import com.example.predator.player.Hunter;
import com.example.predator.player.Target;
	
public class PlayView extends View {

	private StateManager stateManager = null;
	private Target target = null;
	private Hunter hunter = null;
	
	private int mCount = 0;
	
    public PlayView(Context context, StateManager sm) {
        super(context);
        stateManager = sm;
    }
    
    public void registPlayer(Hunter h, Target t){
    	hunter = h;
    	target = t;
    }
    
    
    /**
     * 画面描画
     * 
     * 状態遷移毎に表示内容を切り替える。
     * 
     * @param canvas
     */
    @SuppressLint("DrawAllocation")
	@Override
    public void onDraw(Canvas canvas)
    {
    	switch(stateManager.getState()){
    	case UNKNOWN:			// 初期状態
    	case LOADING:			// 準備中
    		drawLoading(canvas);
    		break;

    	case WAITING:			// 待機中 (ゲーム開始待ち)
    	case PLAYING:			// プレイ中
    		drawPlaying(canvas);
    		break;
    	case WIN:				// 勝ち
    	case WON:				// 負け
    	case END:				// 終了	
    		drawGameOver(canvas);
    		break;
    	}
    	
    }
    
    /**<commit_msg>refactoring<commit_after>package com.example.predator.map;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.View;

import com.example.predator.R;
import com.example.predator.GameState;
import com.example.predator.StateManager;

import com.example.predator.player.Hunter;
import com.example.predator.player.Target;

/**
 * プレイ画面
 * 
 * @author miyamura
 *
 */
public class PlayView extends View {

	private StateManager stateManager = null;
	private Target target = null;
	private Hunter hunter = null;
	
	private int mCount = 0;
	
    public PlayView(Context context, StateManager sm) {
        super(context);
        stateManager = sm;
    }
    
    public void registPlayer(Hunter h, Target t){
    	hunter = h;
    	target = t;
    }
    
    
    /**
     * 画面描画
     * 
     * 状態遷移毎に表示内容を切り替える。
     * 
     * @param canvas
     */
    @SuppressLint("DrawAllocation")
	@Override
    public void onDraw(Canvas canvas)
    {
    	switch(stateManager.getState()){
    	case UNKNOWN:			// 初期状態
    	case LOADING:			// 準備中
    		drawLoading(canvas);
    		break;

    	case WAITING:			// 待機中 (ゲーム開始待ち)
    	case PLAYING:			// プレイ中
    		drawPlaying(canvas);
    		break;
    		
    	case WIN:				// 勝ち
    	case WON:				// 負け
    	case END:				// 終了	
    		drawGameOver(canvas);
    		break;
    	}
    	
    }
    
    /**
{'fraction_non_alphanumeric': 0.10205391527599486, 'fraction_numerical': 0.0006418485237483953, 'mean_word_length': 2.490481522956327, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6436338', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1125, 'n_words': 221}