static public string GetStringWhithColor(string str, e_color color)
    {
        string colorstr = null;

        colorstr = GetColorString(color);
        str      = colorstr + str + "[-]";
        return(str);
    }
    static public int GetColorInt(e_color color)
    {
        int colorstr;

        switch (color)
        {
        default:
            colorstr = 0xFFFFFF;
            break;
        }
        return(colorstr);
    }
    static public string GetColorString(e_color color)
    {
        string colorstr = null;

        switch (color)
        {
        default:
            colorstr = "[FFFFFF]";
            break;
        }
        return(colorstr);
    }
Example #4
0
 public void WannaEditColorTower(e_color newColor, t_infoSlot slot)
 {
     if (slot.color != newColor){
         slot.color = newColor;
         CmdEditColorTower(slot);
     }
 }
Example #5
0
 // Costruttore per fare giocatori di colori particolari
 public Giocatore(e_color colore)
 {
     _colore = colore;
 }
Example #6
0
 // COSTRUTTORI
 //Costruttore di default
 public Giocatore()
 {
     //assegna il colore
     this._colore = (e_color)(++_count);
 }
Example #7
0
        static bool _vShowMessage(e_msg_type flag, string message = "", e_color fg_color = e_color.CL_GREY, e_color bg_color = e_color.CL_BLACK)
        {
            if (message == "")
            {
                console.error("Empty string passed to _vShowMessage()");
                return(false);
            }

            if ((flag == e_msg_type.MSG_INFORMATION && msg_silent == 1) ||
                (flag == e_msg_type.MSG_STATUS && msg_silent == 2) ||
                (flag == e_msg_type.MSG_NOTICE && msg_silent == 4) ||
                (flag == e_msg_type.MSG_WARNING && msg_silent == 8) ||
                (flag == e_msg_type.MSG_ERROR && msg_silent == 16) ||
                (flag == e_msg_type.MSG_SQL && msg_silent == 16) ||
                (flag == e_msg_type.MSG_DEBUG && msg_silent == 32))
            {
                return(false); // Do Not Print it.
            }
            string  prefix = "";
            e_color color  = e_color.CL_GREY;

            switch (flag)
            {
            case e_msg_type.MSG_NONE:     // direct WriteLine replacement.
                break;

            case e_msg_type.MSG_STATUS:     // Bright Green (To inform about good things)
                prefix = "[Status]";
                color  = e_color.CL_GREEN;
                break;

            case e_msg_type.MSG_SQL:     // Bright Violet (For dumping out anything related with SQL)
                prefix = "[SQL]";
                color  = e_color.CL_MAGENTA;
                break;

            case e_msg_type.MSG_INFORMATION:     // Bright White (Variable information)
                prefix = "[Info]";
                color  = e_color.CL_WHITE;
                break;

            case e_msg_type.MSG_NOTICE:     // Bright White (Less than a warning)
                prefix = "[Notice]";
                color  = e_color.CL_WHITE;
                break;

            case e_msg_type.MSG_WARNING:     // Bright Yellow
                prefix = "[Warning]";
                color  = e_color.CL_YELLOW;
                break;

            case e_msg_type.MSG_DEBUG:     // Bright Cyan, important stuff!
                prefix = "[Debug]";
                color  = e_color.CL_CYAN;
                break;

            case e_msg_type.MSG_ERROR:     // Bright Red  (Regular errors)
                prefix = "[Error]";
                color  = e_color.CL_RED;
                break;

            case e_msg_type.MSG_FATALERROR:     // Bright Red (Fatal errors, abort(); If possible)
                prefix = "[Fatal Error]";
                color  = e_color.CL_RED;
                break;

            default:
                error(String.Format("In function _vShowMessage() -> Invalid flag ({0}) passed.", flag));
                return(false);
            }

            Console.ForegroundColor = (ConsoleColor)e_color.CL_GREY;
            char[] letters = prefix.ToCharArray();
            foreach (char c in letters)
            {
                Console.ForegroundColor = (ConsoleColor)color;
                Console.Write(c);
            }
            Console.ForegroundColor = (ConsoleColor)e_color.CL_GREY;
            if (prefix != "")
            {
                Console.Write(" ");
            }

            Console.ForegroundColor = (ConsoleColor)fg_color;
            Console.BackgroundColor = (ConsoleColor)bg_color;

            letters = message.ToCharArray();
            foreach (char c in letters)
            {
                Console.Write(c);
            }

            Console.WriteLine();
            Console.ForegroundColor = (ConsoleColor)e_color.CL_GREY;
            Console.BackgroundColor = (ConsoleColor)e_color.CL_BLACK;

            return(true);
        }
Example #8
0
 public static bool message(string message, e_color fg_color = e_color.CL_GREY, e_color bg_color = e_color.CL_BLACK)
 {
     return(_vShowMessage(e_msg_type.MSG_NONE, message, fg_color, bg_color));
 }
Example #9
0
 // METODI PUBBLICI
 // Per controllare se il pianeta รจ colonizzabile
 public bool Colonizzabile(e_color colore)
 {
     return _colonizzazioni.Any(x => x == 0) && !_colonizzazioni.Any(x => x == colore);
 }