/// <summary> /// Initializes sound files. /// </summary> public static void Initialize(IGameConfig config) { int id = 0; Clear1 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Clear1.mp3")); Clear2 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Clear2.mp3")); Click1 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Click1.mp3")); Click2 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Click2.mp3")); Click3 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Click3.mp3")); Error1 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Error1.mp3")); Explode1 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Explode1.mp3")); Explode2 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Explode2.mp3")); Explode3 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Explode3.mp3")); Hit1 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Hit1.mp3")); Hit2 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Hit2.mp3"), 0.8f); LevelUp1 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "LevelUp1.mp3")); MenuBack1 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "MenuBack1.mp3")); MenuMove1 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "MenuMove1.mp3")); MenuMove2 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "MenuMove2.mp3")); MenuSelect1 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "MenuSelect1.mp3")); MenuSelect2 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "MenuSelect2.mp3")); Music1 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Music1.mp3"), 0.1f, true); Music2 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Music2.mp3"), 0.2f, true); Send1 = new SoundSample(++id, Path.Combine(config.AudioSampleFolder, "Send1.mp3")); }
public ShakeSystem(Contexts contexts) { _contexts = contexts; _config = _contexts.config.gameConfig.value; _shakeGroup = _contexts.game.GetGroup(GameMatcher.AllOf(GameMatcher.Shake, GameMatcher.ShakeDuration, GameMatcher.ShakeAmount, GameMatcher.ShakeOriginalPosition)); }
internal GameSelectorEditor(IGameConfig Config, Action <string> SetGame) { InitializeComponent(); int CurrentGameNode = 0; this.SetGame = SetGame; foreach (IGameModel Game in Config.Games) { int CurrentOptionalNode = 0; TreVie_GamesView.Nodes.Add(Game.Name + ":" + Game.GUID); TreVie_GamesView.Nodes[CurrentGameNode].Nodes.Add(GUID + Game.GUID); TreVie_GamesView.Nodes[CurrentGameNode].Nodes.Add(TheName + Game.Name); TreVie_GamesView.Nodes[CurrentGameNode].Nodes.Add(Path + Game.Path); TreVie_GamesView.Nodes[CurrentGameNode].Nodes.Add(ImagePath + Game.ImagePath); TreVie_GamesView.Nodes[CurrentGameNode].Nodes.Add(PlayTime + Game.PlayTime.ToString()); TreVie_GamesView.Nodes[CurrentGameNode].Nodes.Add(CostToPlay + Game.CostToPlay.ToString()); TreVie_GamesView.Nodes[CurrentGameNode].Nodes.Add(StartOptions + Game.StartOptions); TreVie_GamesView.Nodes[CurrentGameNode].Nodes.Add(OptionalAdditionalExeStarts); foreach (IOptionalAddtionalExeStartsModel OptionalExe in Game.IOptionalAddtionalExeStarts) { TreVie_GamesView.Nodes[CurrentGameNode].Nodes[GameMemoryMap["ExeStarts"]].Nodes.Add(OptionalAdditionalExeStartsIndividual + CurrentOptionalNode); TreVie_GamesView.Nodes[CurrentGameNode].Nodes[GameMemoryMap["ExeStarts"]].Nodes[CurrentOptionalNode].Nodes.Add(Path + OptionalExe.Path); TreVie_GamesView.Nodes[CurrentGameNode].Nodes[GameMemoryMap["ExeStarts"]].Nodes[CurrentOptionalNode].Nodes.Add(Delay + OptionalExe.Delay.ToString()); TreVie_GamesView.Nodes[CurrentGameNode].Nodes[GameMemoryMap["ExeStarts"]].Nodes[CurrentOptionalNode].Nodes.Add(StartOptions + OptionalExe.StartOptions); CurrentOptionalNode++; } TreVie_GamesView.ExpandAll(); CurrentGameNode++; } }
private IEnumerator deleteStarPerform(int starNum, int totalScore, int preScore, int curScore, StarSettlementView settlementView) { for (int i = starNum - 1; i >= 0; i--) { GameObject starObject = gameObject.transform.GetChild(i).gameObject; starObject.SetActive(false); totalScore = totalScore - preScore; totalScore = totalScore >= 0 ? totalScore : 0; //播放消失动画 settlementView.UpdateScore(totalScore); if (totalScore > 0) { yield return(new WaitForSeconds(0.5f)); } } UIManager.Instance.CloseView(settlementView.GetViewID()); //更新当前分数 EventManager.Instance.EventDispatcher.dispatchEvent <int, float, float>(EventEnum.FightUI_Update_LevelInfo, -1, -1, curScore); ChangeLevelView changeLevelView = UIManager.Instance.ShowView <ChangeLevelView>(UIType.Fight_ChangeLevelView); if (changeLevelView) { LevelInfoComponent levelInfo = _context.levelInfo; IGameConfig gameConfig = _context.gameConfig.config; if (levelInfo != null && gameConfig != null) { changeLevelView.Show(levelInfo.curScore >= levelInfo.targetScore, levelInfo.curLevelId >= gameConfig.GetLevelTotalNum()); } } }
public EntityViewBehaviourInitializer(ISceneContext sceneContext, GameContext context, IGameConfig gameConfig, IOsnowaContextManager contextManager) { _sceneContext = sceneContext; _context = context; _gameConfig = gameConfig; _contextManager = contextManager; }
public void Init(IActorController actorController, IActorInitializer actorInitializer, IUiConfig uiConfig, IGameConfig gameConfig) { _actorController = actorController; _actorInitializer = actorInitializer; _uiConfig = uiConfig; _gameConfig = gameConfig; }
private static void LaunchParty(IGameConfig gameConfig) { var game = CreateGame(gameConfig); game.Start(); RemoveGameSubscriptions(game); }
public ResolveAbilitiesPerTurnSystem(GameContext context, IEntityDetector entityDetector, IUiFacade uiFacade, IGameConfig gameConfig) : base(context) { _context = context; _entityDetector = entityDetector; _uiFacade = uiFacade; _gameConfig = gameConfig; }
public void ReplaceGameConfig(IGameConfig newValue) { var index = ConfigComponentsLookup.GameConfig; var component = (GameConfigComponent)CreateComponent(index, typeof(GameConfigComponent)); component.value = newValue; ReplaceComponent(index, component); }
public SoundPlayer(IGameConfig gameConfig, IRandomNumberGenerator rng, GameContext context, IUnityGridInfoProvider unityGridInfoProvider) { _gameConfig = gameConfig; _rng = rng; _context = context; _unityGridInfoProvider = unityGridInfoProvider; }
public void Init(IGameConfig gameConfig) { if (_gameConfig != null) { throw new InvalidOperationException("GameConfig has already been initialized"); } _gameConfig = gameConfig; }
private static GameRoom CreateRoom(IGameConfig config) { GameRoom room = new GameRoom(config); m_rooms.Add(config.Name, room); Logger.WriteLine("Game++"); return(room); }
public static GameRoom CreateOrGetGame(IGameConfig config) { if (m_rooms.ContainsKey(config.Name)) { return(m_rooms[config.Name]); } return(CreateRoom(config)); }
public ShoutWarningAction(GameEntity entity, float energyCost, IBroadcastStimulusSender broadcastStimulusSender, IGameConfig gameConfig, IPositionEffectPresenter positionEffectPresenter, IActionEffectFactory actionEffectFactory) : base(entity, energyCost, actionEffectFactory) { _broadcastStimulusSender = broadcastStimulusSender; _gameConfig = gameConfig; _positionEffectPresenter = positionEffectPresenter; }
public IGameConfig PrepareForGame(IGameConfig gameConfig) { var players = gameConfig?.Players.ToList() ?? CreatePlayers(); var firstPlayer = ChooseFirstPlayer(players); var boardSize = GetBoardSize(); return(_gameConfigFactory.CreateGameConfig(players, firstPlayer, boardSize)); }
//---- public static void Init(IGameConfig _gameConfig, Func <int, IUnitSDS> _getUnitCallBack, Func <int, ISkillSDS> _getSkillCallBack) { gameConfig = _gameConfig; getUnitCallBack = _getUnitCallBack; getSkillCallBack = _getSkillCallBack; }
public void ReplaceGameConfig(IGameConfig newConfig) { var index = GameComponentsLookup.GameConfig; var component = (GameConfigComponent)CreateComponent(index, typeof(GameConfigComponent)); component.config = newConfig; ReplaceComponent(index, component); }
public PresentSurroundingsSystem(IGameConfig gameConfig, IContext <GameEntity> context, ITilePresenter tilePresenter, IVisibilityUpdater visibilityUpdater) : base(context) { _gameConfig = gameConfig; _tilePresenter = tilePresenter; _visibilityUpdater = visibilityUpdater; }
private static IGame CreateGame(IGameConfig config) { var game = GameFactory.CreateGame(config); game.Finished += OnGameFinished; game.StepDone += OnStepDone; return(game); }
public DeathHandler(IUiFacade uiFacade, IViewCreator viewCreator, IGameConfig gameConfig, IPositionEffectPresenter positionEffectPresenter, IOsnowaContextManager contextManager) { _uiFacade = uiFacade; _viewCreator = viewCreator; _gameConfig = gameConfig; _positionEffectPresenter = positionEffectPresenter; _contextManager = contextManager; }
public StimulusHandler(IGameConfig gameConfig, IActivityResolver activityResolver, ISceneContext sceneContext, IFriendshipResolver friendshipResolver, IActivityInterruptor activityInterruptor) { _gameConfig = gameConfig; _activityResolver = activityResolver; _sceneContext = sceneContext; _friendshipResolver = friendshipResolver; _activityInterruptor = activityInterruptor; }
/// <summary> /// Builds an instancer with the kernel32's event catch /// </summary> public GameInstancer(IGameConfig Config, bool AddCloseEvent = false) { this.Config = Config; if (Config == null) { throw new Exception("Not a valid config. Please set to a valid IGameConfig Interface."); } }
public DropAction(GameEntity entity, float energyCost, GameEntity itemToDrop, IActionEffectFactory actionEffectFactory, IFirstPlaceInAreaFinder firstPlaceInAreaFinder, IEntityDetector entityDetector, IGameConfig gameConfig, IUiFacade uiFacade, IPositionEffectPresenter positionEffectPresenter) : base(entity, energyCost, actionEffectFactory) { _itemToDrop = itemToDrop; _firstPlaceInAreaFinder = firstPlaceInAreaFinder; _entityDetector = entityDetector; _gameConfig = gameConfig; _uiFacade = uiFacade; _positionEffectPresenter = positionEffectPresenter; }
public TileMatrixUpdater(IPositionFlagsResolver positionFlagsResolver, IGameConfig gameConfig, ITileByIdProvider tileByIdProvider, ISceneContext sceneContext, IOsnowaContextManager contextManager) { _positionFlagsResolver = positionFlagsResolver; _gameConfig = gameConfig; _tileByIdProvider = tileByIdProvider; _sceneContext = sceneContext; contextManager.ContextReplaced += newContext => _tileMatricesByteByLayer = newContext.TileMatricesByLayer; }
public void ShowStats(IGameConfig gameConfig) { Console.Clear(); ShowHeader(); var stats = "Player: " + gameConfig.Player.Name + "(Win: " + gameConfig.Player.Wins + ")" + "\t Computer: " + gameConfig.Computer.Name + "(win: " + gameConfig.Computer.Wins + ")"; Console.WriteLine(stats); }
public DeathHandler(IGameConfig gameConfig, IUiConfig uiConfig, IEntityRemover entityRemover, IEntitySpawner entitySpawner, IRandomNumberGenerator rng, IGameContext gameContext) { _gameConfig = gameConfig; _uiConfig = uiConfig; _entityRemover = entityRemover; _entitySpawner = entitySpawner; _rng = rng; _gameContext = gameContext; }
public AttackAction(GameEntity entity, float energyCost, IActionEffectFactory actionEffectFactory, IRandomNumberGenerator rng, GameEntity attackedEntity, IGameConfig gameConfig, IAggressionTriggerer aggressionTriggerer, IPositionEffectPresenter positionEffectPresenter, IOsnowaContextManager contextManager, ReactiveFeature reactiveFeature) : base(entity, energyCost, actionEffectFactory) { AttackedEntity = attackedEntity; _rng = rng; _actionEffectFactory = actionEffectFactory; _gameConfig = gameConfig; _contextManager = contextManager; _reactiveFeature = reactiveFeature; }
public EntitySpawner(ItemBehaviour.Factory itemBehaviourFactory, ActorBehaviour.Factory actorBehaviourFactory, IGameContext gameContext, IGameConfig gameConfig, IRandomNumberGenerator rng, IEntityDetector entityDetector, IGridInfoProvider gridInfoProvider) { _itemBehaviourFactory = itemBehaviourFactory; _actorBehaviourFactory = actorBehaviourFactory; _gameContext = gameContext; _gameConfig = gameConfig; _rng = rng; _entityDetector = entityDetector; _gridInfoProvider = gridInfoProvider; }
public void Init(IUnityGridInfoProvider unityGridInfoProvider, IUiFacade uiFacade, IOsnowaContextManager contextManager, ITileByIdProvider tileByIdProvider, IGameConfig gameConfig, IEntityDetector entityDetector, GameContext context) { _tileByIdProvider = tileByIdProvider; _contextManager = contextManager; _uiFacade = uiFacade; _unityGridInfoProvider = unityGridInfoProvider; _gameConfig = gameConfig; _entityDetector = entityDetector; _context = context; }
public TilePresenter(ISceneContext sceneContext, IGameConfig gameConfig, IOsnowaContextManager contextManager, ITileByIdProvider tileByIdProvider, ITileMatrixUpdater tileMatrixUpdater) { _gameConfig = gameConfig; _sceneContext = sceneContext; _contextManager = contextManager; _tileByIdProvider = tileByIdProvider; _tileMatrixUpdater = tileMatrixUpdater; _positionsToReset = new List <Position>(400); }
public void Init() { config = new GameConfigImpl(); string contextPath; if (!config.TryGetStringConfig(StringConfigEnum.ContentPath, out contextPath)) { return; } cardLibrary = new CardLibraryImpl(contextPath + "/Data/card.json"); var c = new CraftImpl(); c.Init(this); craft = c; var raf = new RaffleImpl(); raf.Init(this); raffle = raf; }
public Game(GameRoom room, IGameConfig config) { Config = config; State = GameState.Lobby; IsMatch = config.Mode == 1; IsTag = config.Mode == 2; CurrentPlayer = 0; LifePoints = new int[2]; Players = new Player[IsTag ? 4 : 2]; CurPlayers = new Player[2]; IsReady = new bool[IsTag ? 4 : 2]; m_handResult = new int[2]; m_timelimit = new int[2]; m_bonustime = new int[2]; m_matchResult = new int[6]; Observers = new List<Player>(); if (config.LfList >= 0 && config.LfList < BanlistManager.Banlists.Count) Banlist = BanlistManager.Banlists[config.LfList]; m_room = room; m_analyser = new GameAnalyser(this); }
public Game(IGameConfig config, GameDisplay display) { if (display == null) { State = GameStateWrongDisplay; return; } _display = display; if (config == null || !config.IsGoodConfig()) { State = GameStateWrongConfig; return; } _world = new World(config.GetDimension()); _world.SetLiveCells(config.GetLiveCells()); _display.SetWorld(_world); }