Exemplo n.º 1
0
        // This loads the PLAYPAL palette
        public override Playpal LoadPalette()
        {
            // Error when suspended
            if (issuspended)
            {
                throw new Exception("Data reader is suspended");
            }

            // Palette from wad(s)
            Playpal palette = null;

            foreach (WADReader wr in wads)
            {
                Playpal wadpalette = wr.LoadPalette();
                if (wadpalette != null)
                {
                    return(wadpalette);
                }
            }

            // Find in root directory
            string foundfile = FindFirstFile("PLAYPAL", false);

            if ((foundfile != null) && FileExists(foundfile))
            {
                MemoryStream stream = LoadFile(foundfile);
                palette = new Playpal(stream);
                stream.Dispose();
            }

            // Done
            return(palette);
        }
Exemplo n.º 2
0
        // Constructor
        public DoomPictureReader(Playpal palette)
        {
            // Initialize
            this.palette = palette;

            // We have no destructor
            GC.SuppressFinalize(this);
        }
Exemplo n.º 3
0
        // [ZZ]
        public FileImageReader(uint devilImagetype, int guesstype, Playpal guesspalette)
        {
            imagetype         = devilImagetype;
            this.guesstype    = guesstype;
            this.guesspalette = guesspalette;

            // We have no destructor
            GC.SuppressFinalize(this);
        }
Exemplo n.º 4
0
        public async Task AddPlaypal(string playpalId, string currentUserId)
        {
            var userToAdd = await this.userRepository.GetByIdAsync(playpalId);

            var currentUser = await this.userRepository.GetByIdAsync(currentUserId);

            var newFriendship = new Playpal
            {
                FromUser = currentUser,
                ToUser   = userToAdd
            };

            currentUser.PlaypalsAdded.Add(newFriendship);
            userToAdd.PlaypalsAddedMe.Add(newFriendship);

            this.userRepository.Update(currentUser);
            this.userRepository.Update(userToAdd);
            await this.userRepository.SaveChangesAsync();
        }
 // Constructor
 public ARTImageReader(Playpal palette)
 {
     // Initialize
     this.palette = palette;
 }