public SnapshotSaver(BasicRoom gl, string spellNamea, int aareaWidth, int aareaHeight)
 {
     Console.WriteLine("SnapshotSaver inited");
     gamelink = gl;
     spellName = spellNamea;
     areaWidth = aareaWidth;
     areaHeight = aareaHeight;
 }
Beispiel #2
0
 public Game(string type, string mapId, BasicRoom roomLink, int ggameLength = -1)
 {
     this.roomLink = roomLink;
     gameType = type;
     mapID = mapId;
     gameLength = ggameLength;
     tryStartGame();
 }
Beispiel #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)));
        }
Beispiel #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)));
        }
Beispiel #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());
        }
 public VersionManager(BasicRoom roomLink)
 {
     _roomLink = roomLink;
     _roomLink.AddTimer(checkVersion, 10000); //check version every 10 seconds
     checkVersion();
 }
 public UsersManager(BasicRoom roomLink)
 {
     _registrationManager = new RegistrationManager(roomLink);
     _roomLink = roomLink;
 }
Beispiel #9
0
 public Maps(BasicRoom roomLink)
 {
     _roomLink = roomLink;
     initPresets();
 }
Beispiel #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;
 }
 public TimeLimitedGame(string type, string mapID, BasicRoom room, int ggameLength)
     : base(type, mapID, room, ggameLength)
 {
 }
Beispiel #13
0
 public void setRoomLink(BasicRoom room)
 {
     //called on player when he joined a room
     roomLink = room;
 }
 public FastSprintGame(string type, string mapID, BasicRoom room)
     : base(type, mapID, room, 60)
 {
 }
 public StatisticsManager(BasicRoom roomLink)
 {
     _roomLink = roomLink;
     initTime = Utils.unixSecs();
 }