Skip to content

Commit

Permalink
Dump from Dogfight
Browse files Browse the repository at this point in the history
  • Loading branch information
james7132 committed Mar 21, 2015
1 parent d56f48f commit b992b8c
Show file tree
Hide file tree
Showing 78 changed files with 1,420 additions and 767 deletions.
9 changes: 9 additions & 0 deletions Assets/Demo.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/Demo/Phantasmagoria Demo.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/Demo/Standard Demo.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/External Libraries.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/External Libraries/DanmakuUnity2D.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public abstract class Burst : AttackPattern {
/// An overridable factory method for subclasses to control the various
/// </summary>
/// <value>The controller to be used with the bullets fired with this attack pattern</value>
protected abstract IProjectileGroupController BurstController {
protected abstract IProjectileController BurstController {
get;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ControlledBurst : Burst {

#region implemented abstract members of Burst

protected override IProjectileGroupController BurstController {
protected override IProjectileController BurstController {
get {
// if(controller is ControllerWrapperBehavior<ProjectileControlBehavior>) {
// return (controller as ControllerWrapperBehavior<ProjectileControlBehavior>).Controller;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class CurvedBurst : Burst {

#region implemented abstract members of Burst

protected override IProjectileGroupController BurstController {
protected override IProjectileController BurstController {
get {
return CurvedController;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class LinearBurst : Burst {

#region implemented abstract members of Burst

protected override IProjectileGroupController BurstController {
protected override IProjectileController BurstController {
get {
return LinearController;
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/External Libraries/DanmakuUnity2D/Controllers.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@

namespace Danmaku2D.ProjectileControllers {

public class AggregateProjectileController : ProjectileController, ICollection<IProjectileController> {
public class AggregateProjectileController : IProjectileController, ICollection<IProjectileController> {

private List<IProjectileController> children;

public AggregateProjectileController(params IProjectileController[] children) {
this.children = new List<IProjectileController> (children);
}

#region implemented abstract members of ProjectileController
public override void UpdateProjectile (float dt) {
#region IProjectileController implementation

public void UpdateProjectile (Projectile projectile, float dt) {
for(int i = 0; i < children.Count; i++) {
children[i].Projectile = Projectile;
children[i].UpdateProjectile(dt);
children[i].UpdateProjectile(projectile, dt);
}
}

#endregion

#region ICollection implementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,12 @@ protected override AnimationCurveController CreateController () {
}

[System.Serializable]
public class AnimationCurveController : ProjectileController, IProjectileGroupController {
public class AnimationCurveController : IProjectileController {

[SerializeField]
private AnimationCurve velocityCurve;

#region implemented abstract members of ProjectileController

public sealed override void UpdateProjectile (float dt) {
UpdateProjectile (Projectile, dt);
}

#endregion

#region IProjectileGroupController implementation

public ProjectileGroup ProjectileGroup {
get;
set;
}
#region IProjectileController implementation

public virtual void UpdateProjectile (Projectile projectile, float dt) {
// if(acceleration != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ namespace Danmaku2D.ProjectileControllers {
/// An abstract generic superclass to mirror the functionality of any implementor of IPorjectileGroupController in a ProjectileControlBehavior.
/// It can be used with other ProjectileControlBehavior implementations; however it is best used with IProjectileGroupController implementations that don't derive from ProjectileControlBehavior.
/// </summary>
public abstract class ControllerWrapperBehavior<T> : ProjectileControlBehavior where T : IProjectileGroupController {
public abstract class ControllerWrapperBehavior<T> : ProjectileControlBehavior where T : IProjectileController {

private T controller;
private T projectileController;

/// <summary>
/// Gets the underlying IProjectileGroupController.
/// </summary>
/// <value>The underlying controller.</value>
public T Controller {
get {
return controller;
return projectileController;
}
}

public override void Awake () {
base.Awake ();
if (controller == null) {
controller = CreateController ();
if (controller == null) {
if (projectileController == null) {
projectileController = CreateController ();
if (projectileController == null) {
throw new System.NotImplementedException(GetType().ToString() + " does not implement CreateController() properly");
}
}
Expand All @@ -43,7 +43,7 @@ public override void Awake () {

#region implemented abstract members of ProjectileControlBehavior
public sealed override void UpdateProjectile (Projectile projectile, float dt) {
controller.UpdateProjectile(projectile, dt);
projectileController.UpdateProjectile(projectile, dt);
}
#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,12 @@ namespace Danmaku2D {
/// </summary>
public interface IProjectileController {

/// <summary>
/// Gets or sets the projectile controlled by this controller.
/// </summary>
/// <value>The projectile controlled by this controller</value>
Projectile Projectile { get; set; }

/// <summary>
/// Updates the Projectile controlled by the controller instance.
/// </summary>
/// <returns>the displacement from the Projectile's original position after udpating</returns>
/// <param name="dt">the change in time since the last update</param>
void UpdateProjectile (float dt);
void UpdateProjectile (Projectile projectile, float dt);

}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Danmaku2D {
/// A ProjectileController or ProjectileGroupController for creating bullets that move along a straight path.
/// </summary>
[System.Serializable]
public class LinearProjectile : ProjectileController, IProjectileGroupController {
public class LinearProjectile : IProjectileController {

[SerializeField]
private float velocity = 5;
Expand Down Expand Up @@ -75,19 +75,6 @@ public void SetAcceleration(float accel, float cap) {

#region IProjectileController implementation

public sealed override void UpdateProjectile (float dt) {
UpdateProjectile (Projectile, dt);
}

#endregion

#region IProjectileGroupController implementation

public ProjectileGroup ProjectileGroup {
get;
set;
}

public virtual void UpdateProjectile (Projectile projectile, float dt) {
// if(acceleration != 0) {
// float accelSign = Util.Sign(acceleration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Danmaku2D {

public abstract class ProjectileControlBehavior : MonoBehaviour, IProjectileGroupController {
public abstract class ProjectileControlBehavior : MonoBehaviour, IProjectileController {

private SpriteRenderer spriteRenderer;
public SpriteRenderer SpriteRenderer {
Expand Down Expand Up @@ -32,8 +32,12 @@ public virtual void Awake() {
ProjectileGroup = new ProjectileGroup ();
ProjectileGroup.Controller = this;
}

public abstract void UpdateProjectile(Projectile projectile, float dt);

#region IProjectileController implementation

public abstract void UpdateProjectile (Projectile projectile, float dt);

#endregion
}
}

Loading

0 comments on commit b992b8c

Please sign in to comment.