Mercurial > touhou
changeset 577:e35a083d4208
Move NextStage outside of pytouhou.vm.msg, to be able to use it from anywhere without dependency on EoSD.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 06 Aug 2014 10:50:19 +0200 |
parents | f3778145d7e7 |
children | 00f228b57840 |
files | pytouhou/game/__init__.py pytouhou/game/player.pyx pytouhou/vm/msgrunner.py scripts/pytouhou |
diffstat | 4 files changed, 24 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/pytouhou/game/__init__.py +++ b/pytouhou/game/__init__.py @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- +## +## Copyright (C) 2014 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> +## +## 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
--- 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):
--- 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',
--- 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