예제 #1
0
        // Support Lesson media package now.
        public ContentMapfileManager(IBaseModule baseModule, IConstants constants)
        {
            this.baseModule = baseModule;
            this.constants  = constants;

            this.Mapfile = new Mapfile();

            this.filePath = this.constants.LocalContentPath + string.Format(@"level_{0}_{1}.json", this.baseModule.Id, this.constants.CultureCode);
        }
        // Support Lesson media package now.
        public MediaMapfileManager(IBaseModule baseModule, IConstants constants)
        {
            this.baseModule = baseModule;
            this.constants  = constants;

            this.Mapfile = new Mapfile();

            this.filePath = this.constants.LocalMediaPath + string.Format(@"lesson_{0}.json", this.baseModule.Id);
        }
        // Delete unused files.
        private void DeleteUnusedFiles(string oldMapfile, Mapfile newMapfile)
        {
            // Need Remove unused files.
            Mapfile mapfile = JsonConvert.DeserializeObject <Mapfile>(oldMapfile);

            foreach (var a in mapfile.Files)
            {
                int s = newMapfile.Files.Where(f => f.FileName == a.FileName).Count();
                if (s == 0)
                {
                    var filepath = this.constants.LocalMediaPath + string.Format(@"lesson_{0}\{1}", this.baseModule.Id, a.FileName);
                    File.Delete(filepath);
                }
            }
        }
예제 #4
0
 public override World constructGameWorld(Mapfile path)
 {
     return(new GameWorld(this, path));
 }
예제 #5
0
 public GameWorld(Game theEngine, Mapfile map) : base(theEngine, map)
 {
     teams = new List <LinkedList <AnimalActor> >();
 }