예제 #1
0
        public Board(BoardConfiguration config, int tileSide)
        {
            X = config.X;
            Y = config.Y;
            Width = config.Width;
            Height = config.Height;
            Columns = config.Columns;
            Rows = config.Rows;
            TileSide = tileSide;
            ActualTileSide = (int)(GetTileScale(TileSide, TileSide).X * TileSide);
            this.entity = new Entity() { Name = config.Name }.AddComponent(new BoardBehavior(this));
            this.Tag = "board";
            ChanceSpecial1 = config.Special1Chance;

            List<Objective> objectives = new List<Objective>();
            foreach(ObjectiveConfiguration objectiveConfig in config.Objectives)
            {
                Objective objective = new Objective(objectiveConfig.TileIndex, objectiveConfig.RequiredAmount, objectiveConfig.Name);
                objectives.Add(objective);
            }
            ObjectivesPanel = new ObjectivesPanel(objectives, Width, X, Y + Height);
            this.entity.AddChild(ObjectivesPanel.Entity);
            ObjectivesPanel.Time = TimeSpan.FromSeconds(config.Time);
            ObjectivesPanel.Thresholds = config.Thresholds;
            ObjectivesPanel.TimeFactors = config.TimeFactors;
        }
예제 #2
0
 protected override void ResolveDependencies()
 {
     _objectivesPanel = _parent.ObjectivesPanel;
 }