/// <summary> /// Initializes a new instance of the <see cref="GameEngine" /> class. /// </summary> /// <param name="dependencies">An object which holds the dependencies for the game engine.</param> public GameEngine(GameEngineDependencies dependencies) { this.userInterface = dependencies.UserInterface; this.drawer = this.userInterface.Drawer; this.reader = this.userInterface.Reader; this.commandFactory = dependencies.CommandFactory; this.ctx = new CommandContext(dependencies.Logger, new Board(dependencies.Board.Rows, dependencies.Board.Cols, new RandomGenerator()), 0, 0, dependencies.BoardMemory, Highscore.GetInstance(), new HighscoreProcessor()); }
protected BitmapHunter(IPicasso <Bitmap, Drawable> picasso, Action <Bitmap, Drawable> action, Dispatcher dispatcher, ICache <Bitmap> cache, IRequestHandler <Bitmap> requestHandler) { Action = action; m_Data = action.Request; m_Key = action.Key; m_Picasso = picasso; m_Dispatcher = dispatcher; m_Cache = cache; m_RequestHandler = requestHandler; m_SkipCache = action.SkipCache; }
private BitmapHunter(IPicasso <UIImage, UIImage> picasso, Action <UIImage, UIImage> action, Dispatcher dispatcher, ICache <UIImage> cache, IRequestHandler <UIImage> requestHandler) { Action = action; m_Data = action.Request; m_Key = action.Key; m_Picasso = picasso; m_Dispatcher = dispatcher; m_Cache = cache; m_RequestHandler = requestHandler; m_SkipCache = action.SkipCache; m_CancellationSource = new CancellationTokenSource(); }
protected Action(IPicasso <TBitmap, TError> picasso, object target, Request <TBitmap> request, bool skipCache, FadeMode fadeMode, string key, TError errorImage, System.Action onSuccessListener, System.Action onFailureListener, System.Action onFinishListener) { m_Target = target == null ? null : new WeakReference <Object>(target); m_Picasso = picasso; m_Request = request; m_Key = key; m_SkipCache = skipCache; m_ErrorImage = errorImage; m_FadeMode = fadeMode; m_OnSuccessListener = onSuccessListener; m_OnFailureListener = onFailureListener; m_OnFinishListener = onFinishListener; }
public static BitmapHunter ForRequest(IPicasso <Bitmap, Drawable> picasso, Action <Bitmap, Drawable> action, Dispatcher dispatcher, ICache <Bitmap> cache) { Request <Bitmap> request = action.Request; IList <IRequestHandler <Bitmap> > requestHandlers = picasso.RequestHandlers; // Index-based loop to avoid allocating an iterator. for (int i = 0, count = requestHandlers.Count; i < count; i++) { var requestHandler = requestHandlers[i] as RequestHandler; if (requestHandler != null && requestHandler.CanHandleRequest(request)) { return(new BitmapHunter(picasso, action, dispatcher, cache, requestHandler)); } } return(new BitmapHunter(picasso, action, dispatcher, cache, s_ErrorHandler)); }
public FetchAction(IPicasso <TBitmap, TError> picasso, Request <TBitmap> request, bool skipCache, string key) : base(picasso, null, request, skipCache, FadeMode.Never, key, default(TError), null, null, null) { m_Target = new Object(); }
public TargetAction(IPicasso <TBitmap, TError> picasso, ITarget <TBitmap, TPlaceholder, TError> target, Request <TBitmap> request, bool skipCache, string key, TError errorImage, System.Action onSuccessListener, System.Action onFailureListener, System.Action onFinishListener) : base(picasso, target, request, skipCache, FadeMode.Never, key, errorImage, onSuccessListener, onFailureListener, onFinishListener) { }
public void OnImageLoaded(UIImage image, IPicasso <UIImage, UIImage> picasso, LoadedFrom loadedFrom) { ResetBackgroundColor(); RemoveSpinner(); m_ImageView.Image = image; }
public GetAction(IPicasso <TBitmap, TError> picasso, Request <TBitmap> request, bool skipCache, string key) : base(picasso, null, request, skipCache, FadeMode.Never, key, default(TError), null, null, null) { }