# HG changeset patch # User Emmanuel Gil Peyrot # Date 1407315019 -7200 # Node ID e35a083d42089f98703620e08436a875b775ca19 # Parent f3778145d7e78f23b99341fe69337a0d738ea74e Move NextStage outside of pytouhou.vm.msg, to be able to use it from anywhere without dependency on EoSD. diff --git a/pytouhou/game/__init__.py b/pytouhou/game/__init__.py --- a/pytouhou/game/__init__.py +++ b/pytouhou/game/__init__.py @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- +## +## Copyright (C) 2014 Emmanuel Gil Peyrot +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published +## by the Free Software Foundation; version 3 only. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## + + +class NextStage(Exception): + pass + + +class GameOver(Exception): + pass diff --git a/pytouhou/game/player.pyx b/pytouhou/game/player.pyx --- a/pytouhou/game/player.pyx +++ b/pytouhou/game/player.pyx @@ -20,10 +20,7 @@ from pytouhou.game.bullettype cimport Bu from pytouhou.game.bullet cimport Bullet from pytouhou.game.lasertype cimport LaserType from pytouhou.game.laser cimport PlayerLaser - - -class GameOver(Exception): - pass +from pytouhou.game import GameOver cdef class Player(Element): diff --git a/pytouhou/vm/msgrunner.py b/pytouhou/vm/msgrunner.py --- a/pytouhou/vm/msgrunner.py +++ b/pytouhou/vm/msgrunner.py @@ -16,14 +16,11 @@ from pytouhou.utils.helpers import get_logger from pytouhou.vm.common import MetaRegistry, instruction +from pytouhou.game import NextStage logger = get_logger(__name__) -class NextStage(Exception): - pass - - class MSGRunner(object): __metaclass__ = MetaRegistry __slots__ = ('_msg', '_game', 'frame', 'sleep_time', 'allow_skip', diff --git a/scripts/pytouhou b/scripts/pytouhou --- a/scripts/pytouhou +++ b/scripts/pytouhou @@ -69,10 +69,9 @@ from pytouhou.lib.sdl import SDL, show_s from pytouhou.ui.window import Window from pytouhou.resource.loader import Loader from pytouhou.ui.gamerunner import GameRunner -from pytouhou.game.player import GameOver +from pytouhou.game import NextStage, GameOver from pytouhou.formats.t6rp import T6RP, Level from pytouhou.utils.random import Random -from pytouhou.vm.msgrunner import NextStage from pytouhou.formats.hint import Hint from pytouhou.network import Network