Beispiel #1
0
        public Form1()
        {
            InitializeComponent();
            Sim = new NinjaGame(RenderBox, txtLog, "ouput.txt", 1);

            //foreach (var i in Enum.GetValues(typeof(CardType))) {
            //    comboBox1.Items.Add(((int)i).ToString() + ". " + i.ToString());
            //}
        }
Beispiel #2
0
        public BoardClass(int width, int height, NinjaGame _Sim, Logger _Log, bool fullInit = true)
        {
            TilesX = width;
            TilesY = height;
            Log    = _Log;
            Sim    = _Sim;
            ShadowLastPlayedCard = new EmptyCard();

            if (fullInit)
            {
                Tiles = new Card[width, height];
                PreCalcWalkPattern();
            }
        }
Beispiel #3
0
        public Visualiser(NinjaGame _Sim, PictureBox _RenderTarget)
        {
            Enabled = _RenderTarget != null;
            if (!Enabled)
            {
                return;
            }

            Sim          = _Sim;
            RenderTarget = _RenderTarget;

            CHit = RenderTarget.ClientSize.Height / Sim.Board.TilesY;
            CWid = CHit * .75;

            if (RenderTarget.Image == null)
            {
                RenderTarget.Image = new Bitmap(RenderTarget.ClientSize.Width, RenderTarget.ClientSize.Height);
            }

            g = Graphics.FromImage(RenderTarget.Image);

            stringFormat               = new StringFormat();
            stringFormat.Alignment     = StringAlignment.Center;
            stringFormat.LineAlignment = StringAlignment.Center;

            Pics = new Dictionary <string, Image>();

            try {
                foreach (var f in Directory.GetFiles("img"))
                {
                    Pics[Path.GetFileNameWithoutExtension(f).ToLower()] = Image.FromFile(f);
                }
            } catch { }

            if (Pics.Count == 0)
            {
                UsePics = false;
            }

            FrameTimer = new Stopwatch();
            FrameTimer.Start();
        }