1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-22 16:03:21 +08:00

Rename to CopyStateFrom, and add comment

This commit is contained in:
ekrctb 2020-12-08 23:35:24 +09:00
parent 5ca98b0033
commit 1212ffd24f
2 changed files with 8 additions and 5 deletions

View File

@ -38,7 +38,10 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
Size = new Vector2(CatchHitObject.OBJECT_RADIUS * 2); Size = new Vector2(CatchHitObject.OBJECT_RADIUS * 2);
} }
public virtual void CopyFrom(IHasCatchObjectState objectState) /// <summary>
/// Copies the hit object visual state from another <see cref="IHasCatchObjectState"/> object.
/// </summary>
public virtual void CopyStateFrom(IHasCatchObjectState objectState)
{ {
HitObject = objectState.HitObject; HitObject = objectState.HitObject;
Scale = objectState.Scale; Scale = objectState.Scale;
@ -68,9 +71,9 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
{ {
} }
public override void CopyFrom(IHasCatchObjectState objectState) public override void CopyStateFrom(IHasCatchObjectState objectState)
{ {
base.CopyFrom(objectState); base.CopyStateFrom(objectState);
var fruitState = (IHasFruitState)objectState; var fruitState = (IHasFruitState)objectState;
VisualRepresentation.Value = fruitState.VisualRepresentation.Value; VisualRepresentation.Value = fruitState.VisualRepresentation.Value;

View File

@ -464,7 +464,7 @@ namespace osu.Game.Rulesets.Catch.UI
if (caughtObject == null) return; if (caughtObject == null) return;
caughtObject.CopyFrom(drawableObject); caughtObject.CopyStateFrom(drawableObject);
caughtObject.Anchor = Anchor.TopCentre; caughtObject.Anchor = Anchor.TopCentre;
caughtObject.Position = position; caughtObject.Position = position;
caughtObject.Scale /= 2; caughtObject.Scale /= 2;
@ -525,7 +525,7 @@ namespace osu.Game.Rulesets.Catch.UI
{ {
var droppedObject = getCaughtObject(caughtObject.HitObject); var droppedObject = getCaughtObject(caughtObject.HitObject);
droppedObject.CopyFrom(caughtObject); droppedObject.CopyStateFrom(caughtObject);
droppedObject.Anchor = Anchor.TopLeft; droppedObject.Anchor = Anchor.TopLeft;
droppedObject.Position = caughtFruitContainer.ToSpaceOfOtherDrawable(caughtObject.DrawPosition, droppedObjectTarget); droppedObject.Position = caughtFruitContainer.ToSpaceOfOtherDrawable(caughtObject.DrawPosition, droppedObjectTarget);