Esempio n. 1
0
 public SnapshotSaver(BasicRoom gl, string spellNamea, int aareaWidth, int aareaHeight)
 {
     Console.WriteLine("SnapshotSaver inited");
     gamelink = gl;
     spellName = spellNamea;
     areaWidth = aareaWidth;
     areaHeight = aareaHeight;
 }
Esempio n. 2
0
 public Game(string type, string mapId, BasicRoom roomLink, int ggameLength = -1)
 {
     this.roomLink = roomLink;
     gameType = type;
     mapID = mapId;
     gameLength = ggameLength;
     tryStartGame();
 }
Esempio n. 3
0
        public async Task <IActionResult> Room(string id, int?errorId = null)
        {
            BasicRoom room = await _service.GetBasicRoom(id);

            if (room == null)
            {
                return(RedirectToAction("PageNotFound"));
            }

            return(View(new RoomViewModel(room, errorId)));
        }
Esempio n. 4
0
        public async Task <IActionResult> CreatedRoom(string id)
        {
            BasicRoom room = await _service.GetBasicRoom(id);

            if (room == null)
            {
                return(RedirectToAction("PageNotFound"));
            }

            string roomUrl = Url.RouteUrl("room", new { id }, Request.Scheme);

            return(View(new CreatedRoomViewModel(roomUrl, room.Title)));
        }
Esempio n. 5
0
 public NPCPlayer(BasicRoom ggameLink)
 {
     setRoomLink(ggameLink);
     realID = ggameLink.rand.Next(10000).ToString();
     _spells = new DatabaseObject();
     //TODO: random powerups here
     var splitPowerup = new DatabaseObject();
     splitPowerup.Set(DBProperties.SPELL_SLOT, 1);
     var lightning = new DatabaseObject();
     lightning.Set(DBProperties.SPELL_SLOT, 2);
     _spells.Set(Spells.SPLIT_IN_TWO, splitPowerup); //first panel slot
     _spells.Set(Spells.LIGHTNING_ONE, lightning); //second panel slot
 }
        public async Task <string> CreateRoom(BasicRoom baseData)
        {
            if (baseData?.Title.IsNullOrWhite() ?? true || baseData.People?.Count < 4)
            {
                return("error");
            }

            Room room = new Room(baseData)
            {
                CreationDate = DateTime.UtcNow
            };

            room.Sortear();

            await _repo.AddRoomAsync(room);

            return(room.Id.ToString());
        }
Esempio n. 7
0
 public VersionManager(BasicRoom roomLink)
 {
     _roomLink = roomLink;
     _roomLink.AddTimer(checkVersion, 10000); //check version every 10 seconds
     checkVersion();
 }
Esempio n. 8
0
 public UsersManager(BasicRoom roomLink)
 {
     _registrationManager = new RegistrationManager(roomLink);
     _roomLink = roomLink;
 }
Esempio n. 9
0
 public Maps(BasicRoom roomLink)
 {
     _roomLink = roomLink;
     initPresets();
 }
Esempio n. 10
0
        private const int FIELD_WIDTH_PX = 351; //in pixels

        #endregion Fields

        #region Constructors

        public FieldCells(string mapsProgramData, BasicRoom rroomLink)
        {
            roomLink = rroomLink;
            mapsProgram = new MapsProgram(mapsProgramData);
            createGrid(mapsProgram.getNextMapID());
        }
 public RegistrationManager(BasicRoom roomLink)
 {
     _roomLink = roomLink;
 }
Esempio n. 12
0
 public TimeLimitedGame(string type, string mapID, BasicRoom room, int ggameLength)
     : base(type, mapID, room, ggameLength)
 {
 }
Esempio n. 13
0
 public void setRoomLink(BasicRoom room)
 {
     //called on player when he joined a room
     roomLink = room;
 }
Esempio n. 14
0
 public FastSprintGame(string type, string mapID, BasicRoom room)
     : base(type, mapID, room, 60)
 {
 }
Esempio n. 15
0
 public StatisticsManager(BasicRoom roomLink)
 {
     _roomLink = roomLink;
     initTime = Utils.unixSecs();
 }