コード例 #1
0
ファイル: Helper.cs プロジェクト: lodossDev/xnamugen
		public Helper(FightEngine engine, Character parent, HelperData data)
			: base(engine)
		{
			if (parent == null) throw new ArgumentNullException("parent");
			if (data == null) throw new ArgumentNullException("data");

			m_parent = parent;
			m_baseplayer = m_parent.BasePlayer;
			m_team = m_baseplayer.Team;
			m_offsetcharacter = (data.PositionType == PositionType.P2) ? parent.GetOpponent() : parent;
			m_remove = false;
			m_data = data;
			m_firsttick = true;
			m_statemanager = Parent.StateManager.Clone(this);
			m_spritemanager = Parent.SpriteManager.Clone();
			m_animationmanager = Parent.AnimationManager.Clone();
			m_commandmanager = Parent.CommandManager.Clone();
			m_soundmanager = Parent.SoundManager.Clone();
			m_dimensions = new CharacterDimensions(Data.GroundFront, Data.GroundBack, Data.AirFront, Data.AirBack, Data.Height);
			m_palfx = (Data.OwnPaletteFx == true) ? new PaletteFx() : Parent.PaletteFx;

			CurrentPalette = Parent.CurrentPalette;
			CurrentFacing = GetFacing(Data.PositionType, m_offsetcharacter.CurrentFacing, Data.FacingFlag < 0);
			CurrentLocation = GetStartLocation();
			CurrentScale = Data.Scale;

			SetLocalAnimation(0, 0);

			StateManager.ChangeState(Data.InitialStateNumber);
		}
コード例 #2
0
ファイル: Player.cs プロジェクト: lodossDev/xnamugen
		public Player(FightEngine engine, PlayerProfile profile, Team team)
			: base(engine)
		{
			if (profile == null) throw new ArgumentNullException("profile");
			if (team == null) throw new ArgumentNullException("team");

			m_profile = profile;
			m_spritemanager = Engine.GetSubSystem<Drawing.SpriteSystem>().CreateManager(Profile.SpritePath);
			m_animationmanager = Engine.GetSubSystem<Animations.AnimationSystem>().CreateManager(Profile.AnimationPath);
			m_soundmanager = Engine.GetSubSystem<Audio.SoundSystem>().CreateManager(Profile.SoundPath);
			m_statemanager = Engine.GetSubSystem<StateMachine.StateSystem>().CreateManager(this, Profile.StateFiles);
			m_commandmanager = Engine.GetSubSystem<Commands.CommandSystem>().CreateManager(Profile.CommandPath);
			m_constants = new PlayerConstants(this, Engine.GetSubSystem<IO.FileSystem>().OpenTextFile(Profile.ConstantsPath));
			m_dimensions = new CharacterDimensions(Constants);
			m_palettes = BuildPalettes();
			m_palettenumber = 0;
			m_power = 0;
			m_palfx = new PaletteFx();
			m_team = team;
			m_helpers = new Dictionary<Int32, List<Helper>>();

			if (Engine.GetSubSystem<InitializationSettings>().PreloadCharacterSprites == true)
			{
				SpriteManager.LoadAllSprites();
			}

			SpriteManager.UseOverride = true;

			SetLocalAnimation(0, 0);

			CurrentScale = Constants.Scale;
			PushFlag = true;
		}
コード例 #3
0
ファイル: Player.cs プロジェクト: terrynoya/xnamugen-1
        public Player(FightEngine engine, PlayerProfile profile, PlayerMode mode, Team team)
            : base(engine)
        {
            if (profile == null)
            {
                throw new ArgumentNullException(nameof(profile));
            }
            if (team == null)
            {
                throw new ArgumentNullException(nameof(team));
            }

            m_profile          = profile;
            m_spritemanager    = Engine.GetSubSystem <Drawing.SpriteSystem>().CreateManager(Profile.SpritePath);
            m_animationmanager = Engine.GetSubSystem <Animations.AnimationSystem>().CreateManager(Profile.AnimationPath);
            m_soundmanager     = Engine.GetSubSystem <Audio.SoundSystem>().CreateManager(Profile.SoundPath);
            m_statemanager     = Engine.GetSubSystem <StateMachine.StateSystem>().CreateManager(this, Profile.StateFiles);

            m_commandmanager = Engine.GetSubSystem <Commands.CommandSystem>().CreateManager(mode, Profile.CommandPath);
            m_constants      = new PlayerConstants(this, Engine.GetSubSystem <IO.FileSystem>().OpenTextFile(Profile.ConstantsPath));
            m_dimensions     = new CharacterDimensions(Constants);
            m_palettes       = BuildPalettes();
            m_palettenumber  = 0;
            m_power          = 0;
            m_palfx          = new PaletteFx();
            m_team           = team;
            m_helpers        = new Dictionary <int, List <Helper> >();

            if (Engine.GetSubSystem <InitializationSettings>().PreloadCharacterSprites)
            {
                SpriteManager.LoadAllSprites();
            }

            SpriteManager.UseOverride = true;

            SetLocalAnimation(0, 0);

            CurrentScale = Constants.Scale;
            PushFlag     = true;
        }
コード例 #4
0
ファイル: Helper.cs プロジェクト: terrynoya/xnamugen-1
        public Helper(FightEngine engine, Character parent, HelperData data)
            : base(engine)
        {
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            m_parent           = parent;
            m_baseplayer       = m_parent.BasePlayer;
            m_team             = m_baseplayer.Team;
            m_offsetcharacter  = data.PositionType == PositionType.P2 ? parent.GetOpponent() : parent;
            m_remove           = false;
            m_data             = data;
            m_firsttick        = true;
            m_statemanager     = Parent.StateManager.Clone(this);
            m_spritemanager    = Parent.SpriteManager.Clone();
            m_animationmanager = Parent.AnimationManager.Clone();
            m_commandmanager   = Parent.CommandManager.Clone();
            m_soundmanager     = Parent.SoundManager.Clone();
            m_dimensions       = new CharacterDimensions(Data.GroundFront, Data.GroundBack, Data.AirFront, Data.AirBack, Data.Height);
            m_palfx            = Data.OwnPaletteFx ? new PaletteFx() : Parent.PaletteFx;

            CurrentPalette  = Parent.CurrentPalette;
            CurrentFacing   = GetFacing(Data.PositionType, m_offsetcharacter.CurrentFacing, Data.FacingFlag < 0);
            CurrentLocation = GetStartLocation();
            CurrentScale    = Data.Scale;

            SetLocalAnimation(0, 0);

            StateManager.ChangeState(Data.InitialStateNumber);
        }