Example #1
0
 public Level(BinaryReader br, TRGame ver, string sfxpath = "MAIN.SFX")
 {
     setGameVer(ver);
     reader = br;
     SfxPath = sfxpath;
     Load();
 }
Example #2
0
 public static Engine GameToEngine(TRGame game, out bool isDemoOrUb)
 {
     isDemoOrUb = false;
     switch (game)
     {
         case TRGame.TR1:
             return Engine.TR1;
         case TRGame.TR1Demo:
         case TRGame.TR1UnfinishedBusiness:
             isDemoOrUb = true;
             return Engine.TR1;
         case TRGame.TR2:
         case TRGame.TR2Gold:
             return Engine.TR2;
         case TRGame.TR2Demo:
             isDemoOrUb = true;
             return Engine.TR2;
         case TRGame.TR3:
         case TRGame.TR3Gold:
             return Engine.TR3;
         case TRGame.TR4:
         case TRGame.TR4Demo:
             return Engine.TR4;
         case TRGame.TR5:
             return Engine.TR5;
         default:
             return Engine.Unknown;
     }
 }
Example #3
0
    /// <summary>
    /// 初期化
    /// </summary>
    public void Initialize(TRGame game)
    {
        m_Game = game;

        // サイズ登録
        Height = TRGame.Config.PlayAreaHeight;
        Width  = TRGame.Config.PlayAreaWidth;

        BlockSize = TRGame.Config.GridSize;

        m_Size.x = Width * BlockSize;
        m_Size.y = Height * BlockSize;

        // ブロック生成
        AddLine(Height, true);

        // テトロミノ生成
        m_Tetromino = new TRTetromino();
        CreateNewTetromino();
    }
Example #4
0
 public void Write(BinaryWriter bw, TRGame version)
 {
     setGameVerWrite(version);
     writer = bw;
     internalWriteBefore();
 }
Example #5
0
 public void Write(Stream s, TRGame version)
 {
     using (var bw = new BinaryWriter(s))
     {
         Write(bw, version);
     }
 }
Example #6
0
 public void Write(string fileName, TRGame version)
 {
     if (File.Exists(fileName))
     {
         File.Delete(fileName);
     }
     using (var fs = File.OpenWrite(fileName))
     {
         Write(fs, version);
     }
 }
Example #7
0
 private void setGameVerWrite(TRGame ver)
 {
     WriteGameVersion = ver;
     WriteEngineVersion = Helper.GameToEngine(ver, out WriteIsDemoOrUb);
 }
Example #8
0
 private void setGameVer(TRGame ver)
 {
     GameVersion = ver;
     EngineVersion = Helper.GameToEngine(ver, out IsDemoOrUb);
 }
Example #9
0
        // Open autoexec.

        public static void Res_AutoexecOpen(TRGame engine_version)
        {
            var tempScriptName = Engine.GetAutoexecName(engine_version);

            if(Engine.FileFound(tempScriptName))
            {
                try
                {
                    EngineLua.DoFile(tempScriptName);
                }
                catch(LuaException e)
                {
                    Sys.DebugLog(LUA_LOG_FILENAME, "{0}", e.Message);
                }
            }
        }
Example #10
0
        public static string GetAutoexecName(TRGame gameVersion, string postfix = "")
        {
            var levelName = GetLevelName(GameflowManager.CurrentLevelPath).ToUpper();

            var name = "scripts/autoexec/";

            if(gameVersion < TRGame.TR2)
            {
                name += "tr1/";
            }
            else if(gameVersion < TRGame.TR3)
            {
                name += "tr2/";
            }
            else if(gameVersion < TRGame.TR4)
            {
                name += "tr3/";
            }
            else if(gameVersion < TRGame.TR5)
            {
                name += "tr4/";
            }
            else
            {
                name += "tr5/";
            }

            name += levelName;
            name += postfix;
            name += ".lua";
            return name;
        }
Example #11
0
        public static Engine GameToEngine(TRGame game)
        {
            bool demoOrUb;

            return GameToEngine(game, out demoOrUb);
        }