Ejemplo n.º 1
0
//長方形の形式の抽選結果を返す
func CreateRectForm() RectForm {
	lot := lottery.New(rand.New(rand.NewSource(time.Now().UnixNano())))
	forms := []lottery.Interface{
		horizontalLong,
		verticalLong,
		square,
	}
	result := lot.Lots(
		forms...,
	)
	return forms[result].(RectForm)
}
Ejemplo n.º 2
0
//マップ難易度の抽選結果を返す
func (game_map *GameMap) initMapDifficult() {
	lot := lottery.New(rand.New(rand.NewSource(time.Now().UnixNano())))
	difficults := []lottery.Interface{
		easy,
		normal,
		hard,
		exhard,
	}
	result := lot.Lots(
		difficults...,
	)
	game_map.Difficult = difficults[result].(Difficult)
}