public void AddSelfUser(UserPlayState selfUserPlayState, ItemManagerComponent itemManager) { var playUserIcon = new PlayUserIcon(device, resourceManager, selfUserPlayState, itemManager) { Position = new SharpDX.Vector2(0, ChildrenCount * ItemHeight) }; iconSprite.AddChild(playUserIcon); }
public PlayUserIcon(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, UserPlayState userPlayState, ItemManagerComponent itemManager) : base(device) { this.resourceManager = resourceManager; this.userPlayState = userPlayState; this.itemManager = itemManager; itemManager.EffectAdded += itemManager_EffectAdded; itemManager.EffectRemoved += itemManager_EffectRemoved; InnerStruct(); }
public ItemOverrayComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ItemManagerComponent itemManagerComponent) : base(device) { this.resourceManager = resourceManager; this.itemManagerComponent = itemManagerComponent; }
public override bool Load() { clientHandledData = new Queue <NetworkData>(); client = Param["Client"] as Client; byteReader = Param["ByteReader"] as TcpByteReader; client.Closed += client_Closed; byteReader.ByteReaded += TcpByteReader_ByteReaded; gameRule = Param["GameRule"] as GameRule; userList = new ChangableList <User>(Param["Users"] as User[]); var songInformation = Param["SongInformation"] as SongInformation; var difficulty = (Difficulty)Param["Difficulty"]; var allowedModList = (AllowedModList)Param["AllowedModList"]; selfUser = Param["Self"] as User; userPlayStateList = new ChangableList <UserPlayState>(); userPlayStateList.ItemChanged += userPlayStateList_ItemChanged; userScoreListComponent = new UserScoreListComponent(device, ResourceManager) { Position = new SharpDX.Vector2(680, 45) }; itemManagerComponent = new ItemManagerComponent(device, ResourceManager, gameRule) { Position = new SharpDX.Vector2(682, 420) }; itemOverrayComponent = new ItemOverrayComponent(device, ResourceManager, itemManagerComponent); itemOverrayComponent.ItemSet += itemOverrayComponent_ItemSet; selfPlayState = new UserPlayState { User = selfUser }; foreach (User user in userList) { var userPlayState = new UserPlayState { User = user }; if (user == selfUser) { userScoreListComponent.AddSelfUser(selfPlayState, itemManagerComponent); } else { userPlayStateList.Add(userPlayState); userScoreListComponent.AddUser(userPlayState); } } userScoreListComponent.AddFinish(); black = new RectangleComponent(device, ResourceManager, PPDColors.Black) { RectangleHeight = 450, RectangleWidth = 800, Alpha = 0, Hidden = true }; // メインゲーム用のパラメータの準備 gameutility = new PPDGameUtility { SongInformation = songInformation, Difficulty = difficulty, DifficultString = songInformation.GetDifficultyString(difficulty), Profile = ProfileManager.Instance.Default, AutoMode = AutoMode.None, SpeedScale = 1, Random = false, MuteSE = (bool)Param["MuteSE"], Connect = (bool)Param["Connect"], IsDebug = true, GodMode = true, CanApplyModCallback = m => allowedModList.IsAllowed(m.FileHashString) || !m.ContainsModifyData }; GameInterfaceBase cgi = new GameInterface(device) { Sound = Sound, PPDGameUtility = gameutility, ResourceManager = ResourceManager }; cgi.Load(); pauseMenu = null; if (selfUser.IsLeader) { pauseMenu = new PauseMenu(device) { Sound = Sound, ResourceManager = ResourceManager }; pauseMenu.Load(); pauseMenu.Resumed += pauseMenu_Resumed; pauseMenu.Returned += pauseMenu_Returned; } config = new MainGameConfig(itemManagerComponent); mainGameComponent = new MainGameComponent(device, GameHost, ResourceManager, Sound, this, gameutility, cgi, new MarkImagePaths(), null, pauseMenu, config, songInformation.StartTime, songInformation.StartTime) { PauseMovieWhenPause = false }; filterSprite = new SpriteObject(device); mainGameComponent.Finished += mainGameComponent_Finished; mainGameComponent.Drawed += mainGameComponent_Drawed; mainGameComponent.ScoreChanged += mainGameComponent_ScoreChanged; mainGameComponent.LifeChanged += mainGameComponent_LifeChanged; mainGameComponent.EvaluateChanged += mainGameComponent_EvaluateChanged; mainGameComponent.ComboChanged += mainGameComponent_ComboChanged; mainGameComponent.Initialize(fadeOut, fadeOut, new Dictionary <string, object> { { "MultiItemComponent", itemManagerComponent } }); this.AddChild(black); shouldDisposeItem.AddRange(new GameComponent[] { userScoreListComponent, itemManagerComponent, itemOverrayComponent, mainGameComponent, filterSprite, pauseMenu }); ConnectExpansion(); client.Write(MessagePackSerializer.Serialize(new MainGameLoadedNetworkData())); return(true); }
public MainGameConfig(ItemManagerComponent itemManager) { this.itemManager = itemManager; }