/world/animlayer.go

https://code.google.com/ · Go · 38 lines · 19 code · 4 blank · 15 comment · 0 complexity · a3e01974e8e1b448357fc8cc6bd212c0 MD5 · raw file

  1. /*
  2. Copyright 2011-2012 gtalent2@gmail.com
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package world
  14. import (
  15. "../models"
  16. "github.com/gtalent/starfish/util"
  17. )
  18. type AnimLayer struct {
  19. util.Point
  20. *Animation
  21. }
  22. func (me *AnimLayer) Free() {
  23. animations.Checkin(me.Animation.Key())
  24. }
  25. func loadAnimLayer(anim models.AnimLayer) AnimLayer {
  26. var val AnimLayer
  27. val.Point = anim.Point
  28. a, _ := animations.Checkout(&anim.Animation)
  29. val.Animation = a.(*Animation)
  30. return val
  31. }