Exemple #1
0
        public Tile(SerializationInputStream Stream, Map Map, TileRuleSet RuleSet, IdGenerator IdGenerator)
        {
            this.Map      = Map;
            Coordinate    = new Coordinate(Stream);
            HexCoordinate = new HexCoordinate(Coordinate);
            Id            = IdGenerator.GenerateId();
            Configuration = new TileConfiguration(Stream);
            Bounds        = CalculateBounds();

            this.RuleSet = RuleSet;
            Rules        = new TileRulesCalculator(this);
            Configuration.OnReconfigure += (sender, e) => Rules.Recalculate();
        }
Exemple #2
0
        public Tile(Map Map, Coordinate Coordinate, TileRuleSet RuleSet, IdGenerator IdGenerator)
        {
            this.Map        = Map;
            this.Coordinate = Coordinate;
            this.RuleSet    = RuleSet;
            Id            = IdGenerator.GenerateId();
            HexCoordinate = new HexCoordinate(Coordinate);
            Bounds        = CalculateBounds();

            Configuration = new TileConfiguration();
            Rules         = new TileRulesCalculator(this);
            Configuration.OnReconfigure += (sender, e) => Rules.Recalculate();
        }