Android Open Source - Save-the-Planet I Can Collide






From Project

Back to project page Save-the-Planet.

License

The source code is released under:

Copyright (c) 2002 JSON.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software ...

If you think the Android project Save-the-Planet listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.karolmajta.stp.models;
//from  w w  w  . j av a  2s  .co m
/**
 * Interface for an object that can collide with other object
 * 
 * @author Karol
 *
 * @param <With> Concrete class of an object with whom this ICanCollide
 *     collides
 */
public interface ICanCollide<With> {
  /**
   * This method is called to indicate that a collision between this and
   * other occurred. To be exact it indicates that other collided with
   * this. Given sentence means that implementation of collide should only
   * affect the state of this, not other. This way this can be collided with
   * any object (even one that does not implement ICanCollide).
   * A call to collide should modify the state of this basing on the state
   * of this and other.
   * 
   * Usually the usage of this method will look something like this.
   * 
   * <code>
   * FirstCanCollide a;
   * SecondCanCollide b;
   * a.collide(b) // affects only state of a basing on a and b
   * b.collide(a) // affects only state of b basing on a and b
   * </code>
   * 
   * @param other object that collides with this.
   */
  public void collide(With other);
  
  /**
   * Method for checking basing on state of this and other whether current
   * state of this and other will affect this.
   * This method should be called before collide and if true is returned it is
   * safe to call collide. If false is returned calls to collide can give
   * unexpected (undefined) results.
   * 
   * @param other object that collides with this
   * @return indication if collision occurs and if it's safe to call collide
   */
  public boolean affectedBy(With other);
}




Java Source Code List

com.karolmajta.procprox.DragDetector.java
com.karolmajta.procprox.Drag.java
com.karolmajta.procprox.FontManager.java
com.karolmajta.procprox.IEventFilter.java
com.karolmajta.procprox.TapDetector.java
com.karolmajta.procprox.Tap.java
com.karolmajta.procprox.excepiton.FontNotCreatedException.java
com.karolmajta.stp.LoadingScreenActivity.java
com.karolmajta.stp.MainMenuActivity.java
com.karolmajta.stp.exception.NoDeferredException.java
com.karolmajta.stp.exception.NoTasksInProgressQueueException.java
com.karolmajta.stp.exception.STPException.java
com.karolmajta.stp.exception.UnboundViewException.java
com.karolmajta.stp.models.ICanCollide.java
com.karolmajta.stp.models.IPConstants.java
com.karolmajta.stp.models.IProgress.java
com.karolmajta.stp.models.ITask.java
com.karolmajta.stp.models.ITickable.java
com.karolmajta.stp.models.MainMenuItemBall.java
com.karolmajta.stp.models.MainMenuObstacleBall.java
com.karolmajta.stp.models.ObstacleManager.java
com.karolmajta.stp.models.SyncProgress.java
com.karolmajta.stp.models.SyncTask.java
com.karolmajta.stp.models.Tickable.java
com.karolmajta.stp.models.Viewport.java
com.karolmajta.stp.views.FancyTextView.java
com.karolmajta.stp.views.IDrawable.java
com.karolmajta.stp.views.MainMenuItemBallDebugView.java
com.karolmajta.stp.views.MainMenuItemBallView.java
com.karolmajta.stp.views.MainMenuObstacleBallDebugView.java
com.karolmajta.stp.views.MainMenuObstacleBallView.java
com.karolmajta.stp.views.ObstacleManagerView.java
com.karolmajta.stp.views.ProgressDebugView.java
com.karolmajta.stp.views.ProgressView.java
com.karolmajta.stp.views.View.java