예제 #1
0
파일: Model.cs 프로젝트: jamafyna/park
        public GameRecords(byte playingHeight, byte playingWidth, string InitAmusFilename, string initPathFilename, string initAccFilename, string RevealingRulesFilename) {
            // ----- setting variables -----
            parkClosed = true;
            this.playingHeight = playingHeight;
            this.playingWidth = playingWidth;
            this.internalHeight = (byte)(playingHeight + 2);
            this.internalWidth = (byte)(playingWidth + 2);
            maxAmusementsCount = playingHeight * playingWidth + 1; // max. count of amusements that can user build, + 1 due to the gate which does not lie on the playing place        
            money = initialMoney;

            // ----- creating containers -----
            maps = new Map(internalWidth, internalHeight, this);
            gate = new Gate(this, new Coordinates(0, (byte)(new Random()).Next(1, internalHeight - Gate.height - 1)));
            amusList = new AmusementsList(maxAmusementsCount, gate);

            // ----- loading initialization data -----
            System.Drawing.Image[] im = { Properties.Images.gate, Properties.Images.enter, Properties.Images.exit };
            Data data = new Data(im);
            LoadExternalData(data, InitAmusFilename, initPathFilename, initAccFilename, RevealingRulesFilename);
            images = data.GetImages();
            InitializeCurrBuildedItemsArray(data.GetItemsCount());
            effects = new SpecialEffects(this, data.laterShowedItems);
            data = null; // due to GC

        }
예제 #2
0
 // GameRecords model;
 public GateDetailForm(GameRecords model, Gate gate, Image im)
 {
     InitializeComponent();
     this.a = gate;
     this.gate = gate;
     this.model = model;
     this.pictureBox.BackgroundImage = im;
     this.Text = gate.name;
     gate.isClicked = true;
     MyUpdate();
 }
예제 #3
0
파일: Model.cs 프로젝트: jamafyna/park
 public AmusementsList(int maxAmusCount, Gate gate) {
     this.gate = gate;
     list = new List<Amusements>();
     list.Add(gate);
     foodIds = new List<int>();
     this.maxAmusCount = maxAmusCount;
     freeId = new ConcurrentQueue<int>();
     for (int i = 1; i < maxAmusCount; i++) freeId.Enqueue(i);  //0 is not free, gate.id==0;          
 }