Skip to content

Commit

Permalink
Merge pull request #52 from do-i-know-it/fix/1.0.1
Browse files Browse the repository at this point in the history
Release version 1.0.1 to fix bugs
  • Loading branch information
do-i-know-it committed Nov 1, 2021
2 parents 7002936 + d832144 commit be72ce9
Show file tree
Hide file tree
Showing 23 changed files with 378 additions and 174 deletions.
5 changes: 2 additions & 3 deletions Conduction/IIgnition.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using YggdrAshill.Nuadha.Signalization;
using YggdrAshill.Nuadha.Unitization;
using System;

namespace YggdrAshill.Nuadha.Conduction
{
/// <summary>
/// Connects <typeparamref name="TModule"/> to emit some types of <see cref="ISignal"/>.
/// Connects <typeparamref name="TModule"/> to emit.
/// </summary>
/// <typeparam name="TModule">
/// Type of <see cref="IModule"/> to ignite.
/// Type of <see cref="IModule"/> to connect.
/// </typeparam>
public interface IIgnition<TModule> :
IConnection<TModule>,
Expand Down
7 changes: 3 additions & 4 deletions RELEASE_NOTE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Release notes for version 1.0.0
# Release notes for version 1.0.1

- Modified architecture of framework.
- Modified documents for framework.
- Added samples for framework.
- Fixed implementations of signals for 3D space.
- Fixed document comments for framework.
2 changes: 1 addition & 1 deletion Signalization/IConsumption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public interface IConsumption<TSignal>
where TSignal : ISignal
{
/// <summary>
/// Receives <typeparamref name="TSignal"/>.
/// Receives <typeparamref name="TSignal"/> to consume.
/// </summary>
/// <param name="signal">
/// <typeparamref name="TSignal"/> received.
Expand Down
4 changes: 2 additions & 2 deletions Signalization/IProduction.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace YggdrAshill.Nuadha.Signalization
{
/// <summary>
/// Produces <typeparamref name="TSignal"/>.
/// Produces <typeparamref name="TSignal"/> to send.
/// </summary>
/// <typeparam name="TSignal">
/// Type of <see cref="ISignal"/> to produce.
Expand All @@ -10,7 +10,7 @@ public interface IProduction<TSignal>
where TSignal : ISignal
{
/// <summary>
/// Sends <typeparamref name="TSignal"/> to <see cref="IConsumption{TSignal}"/>.
/// Sends produced <typeparamref name="TSignal"/> to <see cref="IConsumption{TSignal}"/>.
/// </summary>
/// <param name="consumption">
/// <see cref="IConsumption{TSignal}"/> to receive <typeparamref name="TSignal"/>.
Expand Down
3 changes: 0 additions & 3 deletions Signalization/IPropagation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ namespace YggdrAshill.Nuadha.Signalization
/// Type of <see cref="ISignal"/> to propagate.
/// </typeparam>
/// <remarks>
/// Can be combined with <see cref="IGeneration{TSignal}"/> to generate <see cref="ITransmission{TSignal}"/>.
/// In detail, please see <see cref="PropagationExtension.ToTransmit{TSignal}(IPropagation{TSignal}, IGeneration{TSignal})"/>.
/// </remarks>
public interface IPropagation<TSignal> :
IProduction<TSignal>,
IConsumption<TSignal>,
Expand Down
2 changes: 1 addition & 1 deletion Signalization/ISignal.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace YggdrAshill.Nuadha.Signalization
{
/// <summary>
/// Defines signal to send and receive.
/// Defines I/O data to send and receive.
/// </summary>
public interface ISignal
{
Expand Down
46 changes: 26 additions & 20 deletions Signals/Angle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public struct Radian :
private readonly float value;

/// <summary>
/// Constructs an instance.
/// Constructs instance.
/// </summary>
/// <param name="value">
/// <see cref="float"/> for <see cref="Radian"/>.
Expand Down Expand Up @@ -121,45 +121,45 @@ public bool Equals(Radian other)
/// <summary>
/// Converts explicitly <see cref="Radian"/> to <see cref="float"/>.
/// </summary>
/// <param name="radian">
/// <param name="signal">
/// <see cref="Radian"/> to covert.
/// </param>
/// <returns>
/// <see cref="float"/> converted.
/// </returns>
public static explicit operator float(Radian radian)
public static explicit operator float(Radian signal)
{
return radian.value;
return signal.value;
}

/// <summary>
/// Converts explicitly <see cref="Radian"/> to <see cref="Degree"/>.
/// </summary>
/// <param name="radian">
/// <param name="signal">
/// <see cref="Radian"/> to covert.
/// </param>
/// <returns>
/// <see cref="Degree"/> converted.
/// </returns>
public static explicit operator Degree(Radian radian)
public static explicit operator Degree(Radian signal)
{
var value = radian.value * RadianToDegree;
var value = signal.value * RadianToDegree;

return new Degree(value);
}

/// <summary>
/// Inverses <see cref="Radian"/>.
/// </summary>
/// <param name="radian">
/// <param name="signal">
/// <see cref="Radian"/> to inverse.
/// </param>
/// <returns>
/// <see cref="Radian"/> inversed.
/// </returns>
public static Radian operator -(Radian radian)
public static Radian operator -(Radian signal)
{
return new Radian(-radian.value);
return new Radian(-signal.value);
}

/// <summary>
Expand Down Expand Up @@ -248,7 +248,7 @@ public struct Degree :
private readonly float value;

/// <summary>
/// Constructs an instance.
/// Constructs instance.
/// </summary>
/// <param name="value"></param>
/// <exception cref="ArgumentException">
Expand Down Expand Up @@ -278,6 +278,12 @@ public override string ToString()
return $"{value}";
}

/// <inheritdoc/>
public override int GetHashCode()
{
return value.GetHashCode();
}

/// <inheritdoc/>
public override bool Equals(object obj)
{
Expand Down Expand Up @@ -317,45 +323,45 @@ public bool Equals(Degree other)
/// <summary>
/// Converts explicitly <see cref="Degree"/> to <see cref="float"/>.
/// </summary>
/// <param name="degree">
/// <param name="signal">
/// <see cref="Degree"/> to covert.
/// </param>
/// <returns>
/// <see cref="float"/> converted.
/// </returns>
public static explicit operator float(Degree degree)
public static explicit operator float(Degree signal)
{
return degree.value;
return signal.value;
}

/// <summary>
/// Converts explicitly <see cref="Degree"/> to <see cref="Radian"/>.
/// </summary>
/// <param name="degree">
/// <param name="signal">
/// <see cref="Degree"/> to covert.
/// </param>
/// <returns>
/// <see cref="Radian"/> converted.
/// </returns>
public static explicit operator Radian(Degree degree)
public static explicit operator Radian(Degree signal)
{
var value = degree.value * DegreeToRadian;
var value = signal.value * DegreeToRadian;

return new Radian(value);
}

/// <summary>
/// Inverses <see cref="Degree"/>.
/// </summary>
/// <param name="degree">
/// <param name="signal">
/// <see cref="Degree"/> to inverse.
/// </param>
/// <returns>
/// <see cref="Degree"/> inversed.
/// </returns>
public static Degree operator -(Degree degree)
public static Degree operator -(Degree signal)
{
return new Degree(-degree.value);
return new Degree(-signal.value);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Signals/Pull.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public struct Pull :
private readonly float value;

/// <summary>
/// Constructs an instance.
/// Constructs instance.
/// </summary>
/// <param name="value">
/// <see cref="float"/> for <see cref="Pull"/>.
Expand Down
32 changes: 31 additions & 1 deletion Signals/Push.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,15 @@ public bool Equals(Push other)
/// </returns>
public static explicit operator bool(Push signal)
{
return signal == Enabled;
switch (signal.state)
{
case State.Disabled:
return false;
case State.Enabled:
return true;
default:
throw new NotSupportedException(nameof(Push));
}
}

/// <summary>
Expand Down Expand Up @@ -123,6 +131,28 @@ public bool Equals(Push other)
return !(bool)signal;
}

/// <summary>
/// Inverses <see cref="Push"/>.
/// </summary>
/// <param name="signal">
/// <see cref="Push"/> to inverse.
/// </param>
/// <returns>
/// <see cref="Push"/> inversed.
/// </returns>
public static Push operator -(Push signal)
{
switch (signal.state)
{
case State.Disabled:
return Enabled;
case State.Enabled:
return Disabled;
default:
throw new NotSupportedException(nameof(Push));
}
}

/// <summary>
/// Checks if <see cref="Push"/> and <see cref="Push"/> are equal.
/// </summary>
Expand Down
Loading

0 comments on commit be72ce9

Please sign in to comment.