def convierteTablero(id, tamDef, txt):
     ct = BaseConfig.ConfigTablero(id, tamDef)
     tema = ct._tema
     base = ct._base
     li = txt.split("#")
     nli = len(li)
     if nli >= 5:
         tema._colorExterior = int(li[0])
         ct.anchoPieza(int(li[1]))
         tipoPieza = li[2]
         dic = {"c": "Chessicons",
                "m": "Merida",
                "i": "Internet",
                "s": "Spatial",
                "f": "Fantasy",
                "n": "NikNak",
         }
         base._nomPiezas = dic.get(tipoPieza, "NikNak")
         tema._colorBlancas = int(li[3])
         tema._colorNegras = int(li[4])
         tema._colorTexto = tema._colorBlancas
         tema._colorFrontera = tema._colorExterior
         if nli >= 6:
             txt = li[5]
             if txt.isdigit():
                 tema._fTransicion.color = int(txt)
             else:
                 tema._fTransicion = Util.txt2dic(txt)
             if nli >= 7:  # version 6.0
                 tema._colorTexto = int(li[6])
                 if nli >= 8:  # version 6.1
                     tema._colorFrontera = int(li[7])
                     if nli >= 9:  # version 6.2
                         ct.anchoPieza(32)
     return ct
Exemple #2
0
    def confTablero(self, xid, tamDef, padre="BASE"):
        if xid == "BASE":
            ct = BaseConfig.ConfigTablero(xid, tamDef)
        else:
            ct = BaseConfig.ConfigTablero(xid, tamDef, padre=padre)
            ct.anchoPieza(tamDef)

        if xid in self.dicConfTableros:
            ct.lee(self.dicConfTableros[xid])
        else:
            db = Util.DicSQL(self.ficheroConfTableros)
            self.dicConfTableros[xid] = db[xid] = ct.graba()
            db.close()

        ct._anchoPiezaDef = tamDef

        return ct