public PaintPresenter(IPaintForm paintForm, PaintTool paintTool, CanvasFactory canvasFactory, SaveControler saveControler, BitmapLoader bitmapLoader, Caretaker caretaker, OriginatorFactory originatorFactory)
        {
            _paintForm    = paintForm;
            _paintCommand = PaintCommandFactory.GetPaintCommand(PaintToolType.Pencil);
            _paintForm.StartPaintAction += ExecuteStartPaintAction;
            _paintForm.StopPaintAction  += ExecuteStopPaintAction;
            _paintForm.ToolAction       += ExecuteToolAction;
            _paintForm.MovePaintAction  += ExecuteMovePaintAction;
            _paintForm.ColorAction      += ExecuteColorAction;
            _paintForm.SizePenAction    += ExecuteSizePenAction;
            _paintForm.SizeChangeAction += ExecuteSizeChangeAction;
            _paintForm.SaveAction       += ExecuteSaveAction;
            _paintForm.LoadAction       += ExecuteLoadAction;
            _paintForm.RotateAction     += ExecuteRotateAction;
            _paintForm.FlipAction       += ExecuteFlipAction;
            _paintForm.UndoAction       += ExecuteUndoAction;
            _paintForm.BrushAction      += ExecuteBrushAction;

            _paintTool         = paintTool;
            _saveControler     = saveControler;
            _bitmapLoader      = bitmapLoader;
            _currentCanvas     = canvasFactory(400, 400);
            _temporaryCanvas   = canvasFactory(400, 400);
            _caretaker         = caretaker;
            _originator        = originatorFactory(_currentCanvas.Bitmap, _currentCanvas.Width, _currentCanvas.Height);
            _originatorFactory = originatorFactory;
        }
Exemple #2
0
 void Start()
 {
     instance          = this;
     PosicioesIniciais = new Vector3[startPoint.Length];
     DontDestroyOnLoad(gameObject);
     SetarPosicoes();
 }
 void Start()
 {
     TextoVidaAtual.text       = "" + SaveControler.GetVidaLevel(AplicationControler.levelAtual);
     TextoColecionavelMax.text = "" + (SaveControler.TotalColecionavel);
     RefreshScreen();
     panelPause.SetActive(false);
 }
 public void ProximoNivel()
 {
     SaveControler.ZerarConfigLevel(AplicationControler.levelAtual + 1);
     if (AplicationControler.PodeAcessarNivel(AplicationControler.levelAtual + 1))
     {
         SceneManager.LoadScene("Fase_" + (AplicationControler.levelAtual + 1));
         AplicationControler.levelAtual = AplicationControler.levelAtual + 1;
     }
 }
Exemple #5
0
 public void VaiParaOLevel(int levelID)
 {
     if (AplicationControler.PodeAcessarNivel(levelID))
     {
         SaveControler.ZerarConfigLevel(levelID);
         AplicationControler.levelAtual = levelID;
         SceneManager.LoadScene("Fase_" + levelID);
     }
 }
Exemple #6
0
    private void Awake()
    {
        int level = AplicationControler.levelAtual;

        SaveControler.maxVida = VidasLevel;
        if (SaveControler.GetVidaLevel(level) == 0)
        {
            SaveControler.SetVidaLevel(level, VidasLevel);;
        }
        SaveControler.TotalColecionavel = Colecionaveis;
    }
 private void Start()
 {
     for (int i = 0; i < SaveControler.GetStarLevel(AplicationControler.levelAtual); i++)
     {
         stars[i].GetComponent <Image>().color = ActiveStarColor;
     }
     textoVidaAtual.text         = "" + SaveControler.GetVidaLevel(AplicationControler.levelAtual);
     textoVidaMax.text           = "" + SaveControler.maxVida;
     textoColecionavelAtual.text = "" + SaveControler.GetColecionavelLevel(AplicationControler.levelAtual);
     textoColecionavelMax.text   = "" + SaveControler.TotalColecionavel;
     AplicationControler.AdicionaMaxLevelComplete();
 }
 void Awake()
 {
     if (saveControler == null)
     {
         DontDestroyOnLoad(gameObject);
         saveControler = this;
     }
     else
         if (saveControler != this)
         {
             Destroy(gameObject);
         }
 }
    void Start()
    {
        int VidaAtual = SaveControler.GetVidaLevel(AplicationControler.levelAtual);

        textoVidaAtual.text         = "" + (SaveControler.GetVidaLevel(AplicationControler.levelAtual) - 1);
        textoVidaMax.text           = "" + SaveControler.maxVida;
        textoColecionavelAtual.text = "" + SaveControler.GetColecionavelLevel(AplicationControler.levelAtual);
        textoColecionavelMax.text   = "" + SaveControler.TotalColecionavel;
        SaveControler.SetVidaLevel(AplicationControler.levelAtual, VidaAtual - 1);
        VidaAtual = SaveControler.GetVidaLevel(AplicationControler.levelAtual);
        if (SaveControler.GetVidaLevel(AplicationControler.levelAtual) == 0)
        {
            SaveControler.ZerarConfigLevel(AplicationControler.levelAtual);
        }
    }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Player"))
     {
         audio.Play();
         if (!eEsfera)
         {
             PlayerPrefs.SetInt("Seringa" + indexColecionavel, 1);
             SaveControler.SetColecionavelLevel(AplicationControler.levelAtual, SaveControler.GetColecionavelLevel(AplicationControler.levelAtual) + 1);
         }
         else
         {
             PlayerPrefs.SetInt("PortalIsReady", 1);
         }
         uiControler.RefreshScreen();
     }
 }
Exemple #11
0
    public void SalvarEstrelas()
    {
        star = 1;
        int level          = AplicationControler.levelAtual;
        int estrelassalvas = SaveControler.GetStarLevel(level);

        if (SaveControler.GetVidaLevel(level) == VidasLevel)
        {
            star += 1;
        }
        if (SaveControler.GetColecionavelLevel(AplicationControler.levelAtual) == SaveControler.TotalColecionavel)
        {
            star += 1;
        }
        star = estrelassalvas > star ? estrelassalvas : star;
        SaveControler.SetStarLevel(level, star);
    }
Exemple #12
0
 void Start()
 {
     levelSelectControler = FindObjectOfType(typeof(LevelSelectControler)) as LevelSelectControler;
     if (AplicationControler.PodeAcessarNivel(levelACarregar))
     {
         cadeado.SetActive(false);
         for (int i = 0; i < SaveControler.GetStarLevel(levelACarregar); i++)
         {
             stars[i].GetComponent <Image>().color = ActiveStarColor;
         }
     }
     else
     {
         foreach (GameObject stars in stars)
         {
             stars.SetActive(false);
         }
     }
 }
    private void Awake()
    {
        saveControler = FindObjectOfType(typeof(SaveControler)) as SaveControler;
        saveControler.EscolherPosicaoInicial();
        if (PlayerPrefs.HasKey("VOLUME"))
        {
            IsMuted = ((PlayerPrefs.GetInt("VOLUME") == 1) ? false : true);
        }
        else
        {
            PlayerPrefs.SetInt("VOLUME", 1);
        }
        AudioListener.volume = IsMuted ?0:1;


        GroundCheck = transform.Find("GroundCheck");

        corpo2D          = GetComponent <Rigidbody2D>();
        AdcForce         = GetComponent <Rigidbody2D>();
        SaveGame.enabled = false;
    }
Exemple #14
0
    public static void save_json(string fileName, SaveControler saveData)
    {
        LogWriter.Start(MethodBase.GetCurrentMethod().Name, MethodBase.GetCurrentMethod().GetParameters());

        if (!Validation(saveData))
        {
            return;
        }

        string filePath = Constants.SAVES_PATH + fileName + "." + Constants.SAVES_FILENAME_EXTENSION;

        if (!File.Exists(filePath))
        {
            File.Create(filePath).Close();
        }

        File.WriteAllText(filePath, JsonUtility.ToJson(saveData));

        LogWriter.Success("Saved file: " + filePath);

        LogWriter.End(MethodBase.GetCurrentMethod().Name);
    }
Exemple #15
0
    //TODO: Test the new Success bool that was added
    public static SaveControler load_json(string fileName)
    {
        LogWriter.Start(MethodBase.GetCurrentMethod().Name, MethodBase.GetCurrentMethod().GetParameters());

        string filePath = Constants.SAVES_PATH + fileName + "." + Constants.SAVES_FILENAME_EXTENSION;

        SaveControler loadData;

        if (!File.Exists(filePath))
        {
            LogWriter.Error("File not found " + fileName + "." + Constants.SAVES_FILENAME_EXTENSION);
            loadData         = new SaveControler();
            loadData.Success = false;
            return(loadData);
        }

        string str = File.ReadAllText(filePath);

        LogWriter.Success("Loaded file: " + filePath);

        loadData = JsonUtility.FromJson <SaveControler>(str);

        LogWriter.End(MethodBase.GetCurrentMethod().Name, loadData);
        if (Validation(loadData))
        {
            loadData.Success = true;
            LogWriter.End(MethodBase.GetCurrentMethod().Name, loadData);
            return(loadData);
        }

        loadData         = new SaveControler();
        loadData.Success = false;
        LogWriter.Error("Loaded Data isn't Valid");
        LogWriter.End(MethodBase.GetCurrentMethod().Name, loadData);
        return(loadData);
    }
 public void ReiniciarJogo()
 {
     SaveControler.ZerarConfigLevel(AplicationControler.levelAtual);
     SceneManager.LoadScene("Fase_" + AplicationControler.levelAtual);
 }
 public void RefreshScreen()
 {
     TextoColecionavelAtual.text = "" + SaveControler.GetColecionavelLevel(AplicationControler.levelAtual);
     TextoEsferaAtual.text       = "" + (PlayerPrefs.GetInt("PortalIsReady"));
 }
Exemple #18
0
 protected static bool Validation(SaveControler saveData)
 {
     return(true);
 }