Exemplo n.º 1
0
 public AtlasDef(string defName, string file, int pixelsPerTile, int pixelsPerUnit)
     : base("BB:Atlas", defName)
 {
     BB.Assert(pixelsPerUnit > pixelsPerTile);
     BB.Assert((pixelsPerUnit % pixelsPerTile) == 0);
     this.file          = file;
     this.pixelsPerTile = pixelsPerTile;
     this.pixelsPerUnit = pixelsPerUnit;
     this.tilesPerUnit  = pixelsPerUnit / pixelsPerTile;
 }
Exemplo n.º 2
0
        public TerrainDef(string defName, string name,
                          AtlasDef atlas, Vec2I[] spriteFrames, bool passable = true)
            : base("BB:Terrain", defName, name)
        {
            BB.Assert(spriteFrames != null);
            BB.Assert(spriteFrames.Length > 0);

            this.atlas        = atlas;
            this.spriteFrames = spriteFrames;
            this.passable     = passable;
        }
Exemplo n.º 3
0
 public BldgWorkbenchDef(
     string defName, string name,
     BuildingBounds bounds, Vec2I workSpot,
     SpriteDef spriteDown, SpriteDef spriteRight,
     ItemInfo[] materials,
     RecipeDef[] recipes)
     : base("BB:Workbench", defName, name)
 {
     BB.Assert(bounds.IsAdjacent(workSpot));
     this.bounds      = bounds;
     this.workSpot    = workSpot;
     this.spriteDown  = spriteDown;
     this.spriteRight = spriteRight;
     this.materials   = materials;
     this.recipes     = recipes;
 }
Exemplo n.º 4
0
 public override void AbandonWork(Work work)
 {
     BB.Assert(activeWork == work);
     activeWork = null;
 }
Exemplo n.º 5
0
 public void Register(TDef def)
 {
     BB.Assert(!defs.ContainsKey(def.defName));
     defs.Add(def.defName, def);
 }