Esempio n. 1
0
        public static Bitmap ToImage(this Card card)
        {
            var path    = $"UnoSharp.Resources.Cards.{card.Color}.{card.Value}.png";
            var content = EmbedResourceReader.GetStream(path);

            return(new Bitmap(content));
        }
Esempio n. 2
0
        private static Image GetGoldenCard()
        {
            var path    = $"UnoSharp.Resources.Cards.GoldenCard.png";
            var content = EmbedResourceReader.GetStream(path);

            return(new Bitmap(content));
        }
Esempio n. 3
0
        public Dictionary <string, List <string> > GetCommands()
        {
            if (Commands == null)
            {
                var messagesJson = EmbedResourceReader.Read("UnoSharp.Resources.messages.json"); // 默认信息JSON
                Commands = messagesJson.JsonDeserialize <Dictionary <string, List <string> > >();
            }

            return(Commands);
        }
Esempio n. 4
0
        public virtual Bitmap ToImage()
        {
            var path    = $"UnoSharp.Resources.Cards.{this.Color}.{this.Value}.png";
            var content = EmbedResourceReader.GetStream(path);

            if (content == null)
            {
                return((Bitmap)Card.GoldenCardImage);
            }
            return(new Bitmap(content));
        }